Index: gdm-2.24.0/daemon/gdm-greeter-server.c
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-greeter-server.c
+++ gdm-2.24.0/daemon/gdm-greeter-server.c
@@ -215,6 +215,14 @@ gdm_greeter_server_info_query (GdmGreete
 }
 
 gboolean
+gdm_greeter_server_setup_complete (GdmGreeterServer *greeter_server)
+{
+        send_dbus_void_signal (greeter_server, "SetupComplete");
+
+        return TRUE;
+}
+
+gboolean
 gdm_greeter_server_secret_info_query (GdmGreeterServer *greeter_server,
                                       const char       *text)
 {
@@ -724,6 +732,8 @@ do_introspect (DBusConnection *connectio
                                "    </method>\n"
                                "    <method name=\"Disconnect\">\n"
                                "    </method>\n"
+                               "    <method name=\"SetupComplete\">\n"
+                               "    </method>\n"
                                "    <method name=\"GetDisplayId\">\n"
                                "      <arg name=\"id\" direction=\"out\" type=\"o\"/>\n"
                                "    </method>\n"
Index: gdm-2.24.0/daemon/gdm-greeter-server.h
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-greeter-server.h
+++ gdm-2.24.0/daemon/gdm-greeter-server.h
@@ -86,6 +86,7 @@ gboolean            gdm_greeter_server_p
                                                               const char       *text);
 gboolean            gdm_greeter_server_reset                 (GdmGreeterServer *greeter_server);
 gboolean            gdm_greeter_server_ready                 (GdmGreeterServer *greeter_server);
+gboolean            gdm_greeter_server_setup_complete        (GdmGreeterServer *greeter_server);
 void                gdm_greeter_server_selected_user_changed (GdmGreeterServer *greeter_server,
                                                               const char       *text);
 void                gdm_greeter_server_default_language_name_changed (GdmGreeterServer *greeter_server,
Index: gdm-2.24.0/daemon/gdm-session-direct.c
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-session-direct.c
+++ gdm-2.24.0/daemon/gdm-session-direct.c
@@ -806,7 +806,7 @@ gdm_session_direct_handle_username_chang
 
         _gdm_session_selected_user_changed (GDM_SESSION (session), session->priv->selected_user);
 
-        gdm_session_direct_defaults_changed (session);
+        //gdm_session_direct_defaults_changed (session);
 
         return DBUS_HANDLER_RESULT_HANDLED;
 }
Index: gdm-2.24.0/daemon/gdm-session-settings.c
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-session-settings.c
+++ gdm-2.24.0/daemon/gdm-session-settings.c
@@ -300,47 +300,53 @@ gdm_session_settings_load (GdmSessionSet
                 goto out;
         }
 
-        session_name = g_key_file_get_string (key_file, "Desktop", "Session",
-                                              &load_error);
-
-        if (session_name != NULL) {
-                gdm_session_settings_set_session_name (settings, session_name);
-                g_free (session_name);
-        } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
-                g_error_free (load_error);
-                load_error = NULL;
-        } else {
-                g_propagate_error (error, load_error);
-                goto out;
+        if (settings->priv->session_name == NULL) {
+            session_name = g_key_file_get_string (key_file, "Desktop", "Session",
+                                                  &load_error);
+
+            if (session_name != NULL) {
+                    gdm_session_settings_set_session_name (settings, session_name);
+                    g_free (session_name);
+            } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
+                    g_error_free (load_error);
+                    load_error = NULL;
+            } else {
+                    g_propagate_error (error, load_error);
+                    goto out;
+            }
         }
 
-        language_name = g_key_file_get_string (key_file, "Desktop", "Language",
-                                               &load_error);
-
-        if (language_name != NULL) {
-                gdm_session_settings_set_language_name (settings, language_name);
-                g_free (language_name);
-        } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
-                g_error_free (load_error);
-                load_error = NULL;
-        } else {
-                g_propagate_error (error, load_error);
-                goto out;
+        g_warning ("%s: lang = %s", __func__, settings->priv->language_name);
+        if (settings->priv->language_name == NULL) {
+            language_name = g_key_file_get_string (key_file, "Desktop", "Language",
+                                                   &load_error);
+
+            if (language_name != NULL) {
+                    gdm_session_settings_set_language_name (settings, language_name);
+                    g_free (language_name);
+            } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
+                    g_error_free (load_error);
+                    load_error = NULL;
+            } else {
+                    g_propagate_error (error, load_error);
+                    goto out;
+            }
         }
 
-
-        layout_name = g_key_file_get_string (key_file, "Desktop", "Layout",
-                                             &load_error);
-
-        if (layout_name != NULL) {
-                gdm_session_settings_set_layout_name (settings, layout_name);
-                g_free (layout_name);
-        } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
-                g_error_free (load_error);
-                load_error = NULL;
-        } else {
-                g_propagate_error (error, load_error);
-                goto out;
+        if (settings->priv->layout_name == NULL) {
+            layout_name = g_key_file_get_string (key_file, "Desktop", "Layout",
+                                                 &load_error);
+
+            if (layout_name != NULL) {
+                    gdm_session_settings_set_layout_name (settings, layout_name);
+                    g_free (layout_name);
+            } else if (g_error_matches (load_error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND)) {
+                    g_error_free (load_error);
+                    load_error = NULL;
+            } else {
+                    g_propagate_error (error, load_error);
+                    goto out;
+            }
         }
 
         is_loaded = TRUE;
Index: gdm-2.24.0/daemon/gdm-session-worker.c
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-session-worker.c
+++ gdm-2.24.0/daemon/gdm-session-worker.c
@@ -637,6 +637,14 @@ gdm_session_worker_update_username (GdmS
 {
         char    *username;
         gboolean res;
+        GMainContext *context;
+
+        /*
+         * We first go into main loop for recieving D-Bus message.
+         */
+        context = g_main_context_default ();
+        while (g_main_context_pending (context))
+            g_main_context_iteration (context, TRUE);
 
         username = NULL;
         res = gdm_session_worker_get_username (worker, &username);
Index: gdm-2.24.0/daemon/gdm-simple-slave.c
===================================================================
--- gdm-2.24.0.orig/daemon/gdm-simple-slave.c
+++ gdm-2.24.0/daemon/gdm-simple-slave.c
@@ -205,6 +205,7 @@ static void
 on_session_setup_complete (GdmSession     *session,
                            GdmSimpleSlave *slave)
 {
+        gdm_greeter_server_setup_complete (slave->priv->greeter_server);
         gdm_session_authenticate (session);
 }
 
Index: gdm-2.24.0/gui/simple-greeter/gdm-greeter-client.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-greeter-client.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-greeter-client.c
@@ -71,6 +71,7 @@ enum {
         DEFAULT_SESSION_NAME_CHANGED,
         TIMED_LOGIN_REQUESTED,
         USER_AUTHORIZED,
+        SETUP_COMPLETE,
         LAST_SIGNAL
 };
 
@@ -206,6 +207,15 @@ on_user_authorized (GdmGreeterClient *cl
 }
 
 static void
+on_setup_complete (GdmGreeterClient *client,
+                   DBusMessage      *message)
+{
+        g_signal_emit (client,
+                       gdm_greeter_client_signals[SETUP_COMPLETE],
+                       0);
+}
+
+static void
 on_info_query (GdmGreeterClient *client,
                DBusMessage      *message)
 {
@@ -633,7 +643,9 @@ client_dbus_handle_message (DBusConnecti
         g_return_val_if_fail (connection != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
         g_return_val_if_fail (message != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
 
-        if (dbus_message_is_signal (message, GREETER_SERVER_DBUS_INTERFACE, "InfoQuery")) {
+        if (dbus_message_is_signal (message, GREETER_SERVER_DBUS_INTERFACE, "SetupComplete")) {
+                on_setup_complete (client, message);
+        } else if (dbus_message_is_signal (message, GREETER_SERVER_DBUS_INTERFACE, "InfoQuery")) {
                 on_info_query (client, message);
         } else if (dbus_message_is_signal (message, GREETER_SERVER_DBUS_INTERFACE, "SecretInfoQuery")) {
                 on_secret_info_query (client, message);
@@ -945,6 +957,16 @@ gdm_greeter_client_class_init (GdmGreete
                               G_TYPE_NONE,
                               2, G_TYPE_STRING, G_TYPE_INT);
 
+        gdm_greeter_client_signals[SETUP_COMPLETE] =
+                g_signal_new ("setup-complete",
+                              G_OBJECT_CLASS_TYPE (object_class),
+                              G_SIGNAL_RUN_FIRST,
+                              G_STRUCT_OFFSET (GdmGreeterClientClass, setup_complete),
+                              NULL,
+                              NULL,
+                              g_cclosure_marshal_VOID__VOID,
+                              G_TYPE_NONE, 0);
+
         gdm_greeter_client_signals[USER_AUTHORIZED] =
                 g_signal_new ("user-authorized",
                               G_OBJECT_CLASS_TYPE (object_class),
Index: gdm-2.24.0/gui/simple-greeter/gdm-greeter-client.h
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-greeter-client.h
+++ gdm-2.24.0/gui/simple-greeter/gdm-greeter-client.h
@@ -70,6 +70,7 @@ typedef struct
                                           const char        *username,
                                           int                delay);
         void (* user_authorized)         (GdmGreeterClient  *client);
+        void (* setup_complete)          (GdmGreeterClient  *client);
 } GdmGreeterClientClass;
 
 #define GDM_GREETER_CLIENT_ERROR (gdm_greeter_client_error_quark ())
Index: gdm-2.24.0/gui/simple-greeter/gdm-greeter-panel.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-greeter-panel.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-greeter-panel.c
@@ -534,6 +534,45 @@ on_session_activated (GdmSessionOptionWi
         g_free (session);
 }
 
+char *
+gdm_greeter_panel_get_current_session (GdmGreeterPanel *panel)
+{
+        char *session;
+
+        session = gdm_session_option_widget_get_current_session (GDM_SESSION_OPTION_WIDGET (panel->priv->session_option_widget));
+
+        return session;
+}
+
+char *
+gdm_greeter_panel_get_current_layout (GdmGreeterPanel *panel)
+{
+    char *layout;
+
+    layout = gdm_layout_option_widget_get_current_layout_name (GDM_LAYOUT_OPTION_WIDGET (panel->priv->layout_option_widget));
+
+    return layout;
+}
+
+char *
+gdm_greeter_panel_get_current_language (GdmGreeterPanel *panel)
+{
+    char *language;
+
+    language = gdm_language_option_widget_get_current_language_name (GDM_LANGUAGE_OPTION_WIDGET (panel->priv->language_option_widget));
+
+    return language;
+}
+
+char *
+gdm_greeter_panel_get_current_domain (GdmGreeterPanel *panel)
+{
+    char *domain;
+
+    domain = gdm_domain_option_widget_get_current_domain_name (GDM_DOMAIN_OPTION_WIDGET (panel->priv->domain_option_widget));
+
+    return domain;
+}
 static void
 on_domain_activated (GdmDomainOptionWidget *widget,
                      GdmGreeterPanel        *panel)
Index: gdm-2.24.0/gui/simple-greeter/gdm-greeter-panel.h
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-greeter-panel.h
+++ gdm-2.24.0/gui/simple-greeter/gdm-greeter-panel.h
@@ -77,6 +77,11 @@ void                   gdm_greeter_panel
                                                                          const char      *session_name);
 void                   gdm_greeter_panel_set_default_domain_name        (GdmGreeterPanel *panel,
                                                                          const char      *domain_name);
+
+char                 * gdm_greeter_panel_get_current_session            (GdmGreeterPanel *panel);
+char                 * gdm_greeter_panel_get_current_language           (GdmGreeterPanel *panel);
+char                 * gdm_greeter_panel_get_current_layout             (GdmGreeterPanel *panel);
+char                 * gdm_greeter_panel_get_current_domain             (GdmGreeterPanel *panel);
 G_END_DECLS
 
 #endif /* __GDM_GREETER_PANEL_H */
Index: gdm-2.24.0/gui/simple-greeter/gdm-greeter-session.c
===================================================================
--- gdm-2.24.0.orig/gui/simple-greeter/gdm-greeter-session.c
+++ gdm-2.24.0/gui/simple-greeter/gdm-greeter-session.c
@@ -55,6 +55,7 @@ struct GdmGreeterSessionPrivate
         char                  *domain;
 
         gint                   n_info_queries;
+        gboolean               signal_connect;
 };
 
 enum {
@@ -192,9 +193,28 @@ on_user_authorized (GdmGreeterClient  *c
                     GdmGreeterSession *session)
 {
         g_debug ("GdmGreeterSession: user authorized");
+        char *text;
+
+        text = gdm_greeter_panel_get_current_session (GDM_GREETER_PANEL (session->priv->panel));
+
+        gdm_greeter_client_call_select_session (session->priv->client,
+                                                text);
+        g_free (text);
+
+        text = gdm_greeter_panel_get_current_language (GDM_GREETER_PANEL (session->priv->panel));
+
+        gdm_greeter_client_call_select_language (session->priv->client,
+                                                 text);
+        g_free (text);
+        text = gdm_greeter_panel_get_current_layout (GDM_GREETER_PANEL (session->priv->panel));
+        gdm_greeter_client_call_select_layout (session->priv->client,
+                                               text);
+        g_free (text);
+
         gdm_greeter_login_window_user_authorized (GDM_GREETER_LOGIN_WINDOW (session->priv->login_window));
 }
 
+
 static void
 on_info_query (GdmGreeterClient  *client,
                const char        *text,
@@ -309,6 +329,34 @@ on_select_domain (GdmGreeterSession
 }
 
 static void
+on_setup_complete (GdmGreeterClient  *client,
+                   GdmGreeterSession *session)
+{
+        if (!session->priv->signal_connect) {
+                g_signal_connect_swapped (session->priv->panel,
+                                          "language-selected",
+                                          G_CALLBACK (on_select_language),
+                                          session);
+
+                g_signal_connect_swapped (session->priv->panel,
+                                          "layout-selected",
+                                          G_CALLBACK (on_select_layout),
+                                          session);
+
+                g_signal_connect_swapped (session->priv->panel,
+                                          "session-selected",
+                                          G_CALLBACK (on_select_session),
+                                          session);
+
+                g_signal_connect_swapped (session->priv->panel,
+                                          "domain-selected",
+                                          G_CALLBACK (on_select_domain),
+                                          session);
+                session->priv->signal_connect = TRUE;
+        }
+}
+
+static void
 on_select_user (GdmGreeterLoginWindow *login_window,
                 const char            *text,
                 GdmGreeterSession     *session)
@@ -335,6 +383,25 @@ static void
 on_cancelled (GdmGreeterLoginWindow *login_window,
               GdmGreeterSession     *session)
 {
+        if (session->priv->signal_connect == TRUE) {
+                g_signal_handlers_disconnect_by_func (session->priv->panel,
+                                                     G_CALLBACK (on_select_language),
+                                                     session);
+
+                g_signal_handlers_disconnect_by_func (session->priv->panel,
+                                                     G_CALLBACK (on_select_layout),
+                                                     session);
+
+                g_signal_handlers_disconnect_by_func (session->priv->panel,
+                                                     G_CALLBACK (on_select_session),
+                                                     session);
+
+                g_signal_handlers_disconnect_by_func (session->priv->panel,
+                                                     G_CALLBACK (on_select_domain),
+                                                     session);
+                session->priv->signal_connect = FALSE;
+        }
+
         gdm_greeter_panel_hide_user_options (GDM_GREETER_PANEL (session->priv->panel));
         gdm_greeter_client_call_cancel (session->priv->client);
 
@@ -375,25 +442,6 @@ toggle_panel (GdmGreeterSession *session
 
                 session->priv->panel = gdm_greeter_panel_new (screen, monitor);
 
-                g_signal_connect_swapped (session->priv->panel,
-                                          "language-selected",
-                                          G_CALLBACK (on_select_language),
-                                          session);
-
-                g_signal_connect_swapped (session->priv->panel,
-                                          "layout-selected",
-                                          G_CALLBACK (on_select_layout),
-                                          session);
-
-                g_signal_connect_swapped (session->priv->panel,
-                                          "session-selected",
-                                          G_CALLBACK (on_select_session),
-                                          session);
-
-                g_signal_connect_swapped (session->priv->panel,
-                                          "domain-selected",
-                                          G_CALLBACK (on_select_domain),
-                                          session);
 
                 gtk_widget_show (session->priv->panel);
         } else {
@@ -636,9 +684,15 @@ gdm_greeter_session_init (GdmGreeterSess
                           "user-authorized",
                           G_CALLBACK (on_user_authorized),
                           session);
+        g_signal_connect (session->priv->client,
+                          "setup-complete",
+                          G_CALLBACK (on_setup_complete),
+                          session);
 
         session->priv->n_info_queries = 0;
 
+        session->priv->signal_connect = FALSE;
+
         /* We want to listen for panel mnemonics even if the
          * login window is focused, so we intercept them here.
          */
