gdm r5969 - in trunk: . gui/simple-greeter



Author: halfline
Date: Sun Mar  9 21:31:59 2008
New Revision: 5969
URL: http://svn.gnome.org/viewvc/gdm?rev=5969&view=rev

Log:
2008-03-09  Ray Strode  <rstrode redhat com>

	* gui/simple-greeter/gdm-greeter-login-window.[ch]:
	(on_login_button_clicked_answer_query):
	(gdm_greeter_login_window_class_init):
	* gui/simple-greeter/gdm-greeter-session.c:
	(GdmGreeterSessionPrivate), (on_reset),
	(on_interactive), (toggle_login_window):
	Add new "interactive" signal to login window which is
	emitted when the user has had an opportunity to interact
	with session / language choosers. Have greeter session
	watch for this signal to decide when to tell the slave
	when to proceed with starting the session


Modified:
   trunk/ChangeLog
   trunk/gui/simple-greeter/gdm-greeter-login-window.c
   trunk/gui/simple-greeter/gdm-greeter-login-window.h
   trunk/gui/simple-greeter/gdm-greeter-session.c

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.c	Sun Mar  9 21:31:59 2008
@@ -144,6 +144,7 @@
         USER_SELECTED,
         DISCONNECTED,
         CANCELLED,
+        INTERACTIVE,
         LAST_SIGNAL
 };
 
@@ -349,6 +350,7 @@
         entry = glade_xml_get_widget (login_window->priv->xml, "auth-prompt-entry");
         text = gtk_entry_get_text (GTK_ENTRY (entry));
 
+        g_signal_emit (login_window, signals[INTERACTIVE], 0);
         g_signal_emit (login_window, signals[QUERY_ANSWER], 0, text);
 }
 
@@ -1601,6 +1603,16 @@
                               g_cclosure_marshal_VOID__VOID,
                               G_TYPE_NONE,
                               0);
+        signals [INTERACTIVE] =
+                g_signal_new ("interactive",
+                              G_TYPE_FROM_CLASS (object_class),
+                              G_SIGNAL_RUN_LAST,
+                              G_STRUCT_OFFSET (GdmGreeterLoginWindowClass, interactive),
+                              NULL,
+                              NULL,
+                              g_cclosure_marshal_VOID__VOID,
+                              G_TYPE_NONE, 0);
+
         g_object_class_install_property (object_class,
                                          PROP_DISPLAY_IS_LOCAL,
                                          g_param_spec_boolean ("display-is-local",

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.h
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.h	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.h	Sun Mar  9 21:31:59 2008
@@ -56,6 +56,7 @@
                                               const char            *text);
         void (* cancelled)                   (GdmGreeterLoginWindow *login_window);
         void (* disconnected)                (GdmGreeterLoginWindow *login_window);
+        void (* interactive)                 (GdmGreeterLoginWindow *login_window);
 
 } GdmGreeterLoginWindowClass;
 

Modified: trunk/gui/simple-greeter/gdm-greeter-session.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-session.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-session.c	Sun Mar  9 21:31:59 2008
@@ -63,6 +63,8 @@
 
         GtkWidget             *login_window;
         GtkWidget             *panel;
+
+        guint                  was_interactive : 1;
 };
 
 enum {
@@ -114,6 +116,8 @@
 
         gdm_greeter_panel_reset (GDM_GREETER_PANEL (session->priv->panel));
         gdm_greeter_login_window_reset (GDM_GREETER_LOGIN_WINDOW (session->priv->login_window));
+
+        session->priv->was_interactive = FALSE;
 }
 
 static void
@@ -238,6 +242,24 @@
 }
 
 static void
+on_interactive (GdmGreeterLoginWindow *login_window,
+                  GdmGreeterSession     *session)
+{
+        if (!session->priv->was_interactive) {
+                g_debug ("GdmGreeterSession: session was interactive\n");
+
+                /* We've blocked the UI already for the user to answer a question,
+                 * so we know they've had an opportunity to interact with
+                 * language chooser session selector, etc, and we can start the
+                 * session right away.
+                 */
+                gdm_greeter_client_call_start_session_when_ready (session->priv->client,
+                                                                  TRUE);
+                session->priv->was_interactive = TRUE;
+        }
+}
+
+static void
 toggle_panel (GdmSessionManager *manager,
               gboolean           enabled,
               GdmGreeterSession *session)
@@ -302,6 +324,10 @@
                                   "disconnected",
                                   G_CALLBACK (on_disconnected),
                                   session);
+                g_signal_connect (session->priv->login_window,
+                                  "interactive",
+                                  G_CALLBACK (on_interactive),
+                                  session);
                 gtk_widget_show (session->priv->login_window);
         } else {
                 gtk_widget_destroy (session->priv->login_window);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]