[gdm/gnome-2-30] Fix layout handling after "Cancel"



commit 2b61c0c20e3f92ca61f248a1efccf8d22b7facba
Author: Ray Strode <rstrode redhat com>
Date:   Tue Jun 22 15:36:44 2010 -0400

    Fix layout handling after "Cancel"
    
    When a user chooses a layout and then clicks "Cancel",
    GDM gets confused.  This is because, in part, that layouts
    were being treated much the same as sessions and language,
    which aren't things activated immediately.
    
    This commit changes the layout handling, such that when
    it changes state, it's updated in all three places at the
    same time:
    
    1) The active layout in the X server
    2) The active item in the list
    3) The default item in the list
    
    Note, this is a bandaid. The whole thing is a bit wonky though, and
    needs to be redone.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622430
    (cherry picked from commit 09f5aa04496c0ca66db7654628bd94cbf3f8bcbb)

 gui/simple-greeter/gdm-greeter-panel.c   |    8 +++++---
 gui/simple-greeter/gdm-greeter-panel.h   |    4 ++--
 gui/simple-greeter/gdm-greeter-session.c |    4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-greeter-panel.c b/gui/simple-greeter/gdm-greeter-panel.c
index ec3b603..a852646 100644
--- a/gui/simple-greeter/gdm-greeter-panel.c
+++ b/gui/simple-greeter/gdm-greeter-panel.c
@@ -1023,8 +1023,8 @@ gdm_greeter_panel_hide_user_options (GdmGreeterPanel *panel)
 void
 gdm_greeter_panel_reset (GdmGreeterPanel *panel)
 {
+        gdm_greeter_panel_set_keyboard_layout (panel, NULL);
         gdm_greeter_panel_set_default_language_name (panel, NULL);
-        gdm_greeter_panel_set_default_layout_name (panel, NULL);
         gdm_greeter_panel_set_default_session_name (panel, NULL);
         gdm_greeter_panel_hide_user_options (panel);
 }
@@ -1057,8 +1057,8 @@ gdm_greeter_panel_set_default_language_name (GdmGreeterPanel *panel,
 }
 
 void
-gdm_greeter_panel_set_default_layout_name (GdmGreeterPanel *panel,
-                                           const char      *layout_name)
+gdm_greeter_panel_set_keyboard_layout (GdmGreeterPanel *panel,
+                                       const char      *layout_name)
 {
 #ifdef HAVE_LIBXKLAVIER
         g_return_if_fail (GDM_IS_GREETER_PANEL (panel));
@@ -1084,6 +1084,8 @@ gdm_greeter_panel_set_default_layout_name (GdmGreeterPanel *panel,
                                                    layout_name);
         }
 
+        gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (panel->priv->layout_option_widget),
+                                           layout_name);
         gdm_option_widget_set_default_item (GDM_OPTION_WIDGET (panel->priv->layout_option_widget),
                                             layout_name);
 
diff --git a/gui/simple-greeter/gdm-greeter-panel.h b/gui/simple-greeter/gdm-greeter-panel.h
index f7e968f..6a4848e 100644
--- a/gui/simple-greeter/gdm-greeter-panel.h
+++ b/gui/simple-greeter/gdm-greeter-panel.h
@@ -64,11 +64,11 @@ GtkWidget            * gdm_greeter_panel_new                            (GdkScre
 void                   gdm_greeter_panel_show_user_options              (GdmGreeterPanel *panel);
 void                   gdm_greeter_panel_hide_user_options              (GdmGreeterPanel *panel);
 void                   gdm_greeter_panel_reset                          (GdmGreeterPanel *panel);
+void                   gdm_greeter_panel_set_keyboard_layout            (GdmGreeterPanel *panel,
+                                                                         const char      *layout_name);
 
 void                   gdm_greeter_panel_set_default_language_name      (GdmGreeterPanel *panel,
                                                                          const char      *language_name);
-void                   gdm_greeter_panel_set_default_layout_name        (GdmGreeterPanel *panel,
-                                                                         const char      *layout_name);
 void                   gdm_greeter_panel_set_default_session_name       (GdmGreeterPanel *panel,
                                                                          const char      *session_name);
 G_END_DECLS
diff --git a/gui/simple-greeter/gdm-greeter-session.c b/gui/simple-greeter/gdm-greeter-session.c
index 41336c6..3b89bc8 100644
--- a/gui/simple-greeter/gdm-greeter-session.c
+++ b/gui/simple-greeter/gdm-greeter-session.c
@@ -138,8 +138,8 @@ on_default_layout_name_changed (GdmGreeterClient  *client,
                                 GdmGreeterSession *session)
 {
         g_debug ("GdmGreeterSession: default layout name changed: %s", text);
-        gdm_greeter_panel_set_default_layout_name (GDM_GREETER_PANEL (session->priv->panel),
-                                                   text);
+        gdm_greeter_panel_set_keyboard_layout (GDM_GREETER_PANEL (session->priv->panel),
+                                               text);
 }
 
 static void



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