--- gdm/daemon/gdm-session-direct.c.orig	2009-09-09 11:47:25.000000000 +0900
+++ gdm/daemon/gdm-session-direct.c	2009-10-21 18:20:02.000000000 +0900
@@ -1954,12 +1954,9 @@ setup_session_environment (GdmSessionDir
                                                      "GDM_LANG",
                                                      get_language_name (session));
 
-        if (strcmp (get_layout_name (session),
-                    get_default_layout_name (session)) == 0) {
-                gdm_session_direct_set_environment_variable (session,
-                                                             "GDM_KEYBOARD_LAYOUT",
-                                                             get_layout_name (session));
-        }
+        gdm_session_direct_set_environment_variable (session,
+                                                     "GDM_KEYBOARD_LAYOUT",
+                                                     get_layout_name (session));
 
         gdm_session_direct_set_environment_variable (session,
                                                      "DISPLAY",
--- gdm/daemon/gdm-session-settings.c.orig	2009-10-21 18:17:52.000000000 +0900
+++ gdm/daemon/gdm-session-settings.c	2009-10-21 18:18:02.000000000 +0900
@@ -149,10 +149,17 @@ gdm_session_settings_set_layout_name (Gd
 {
         g_return_if_fail (GDM_IS_SESSION_SETTINGS (settings));
 
-        if (settings->priv->layout_name == NULL ||
-            strcmp (settings->priv->layout_name, layout_name) != 0) {
+        /* If the layout_name is the previous one, need to send
+         * slave the layout_name. But if the layout_name is choosed on
+         * greeter chooser, should not send slave it so that
+         * slave's saved_layout is not changed.
+         * The layout_name will be saved in .dmrc. */
+        if (settings->priv->layout_name == NULL) {
                 settings->priv->layout_name = g_strdup (layout_name);
                 g_object_notify (G_OBJECT (settings), "layout-name");
+        } else if (g_strcmp0 (settings->priv->layout_name, layout_name) != 0) {
+                g_free (settings->priv->layout_name);
+                settings->priv->layout_name = g_strdup (layout_name);
         }
 }
 
