diff options
-rw-r--r-- | gui/simple-greeter/gdm-chooser-widget.c | 6 | ||||
-rw-r--r-- | gui/simple-greeter/gdm-user-chooser-widget.c | 25 |
2 files changed, 21 insertions, 10 deletions
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c index d8d39ef9..fd97cdb6 100644 --- a/gui/simple-greeter/gdm-chooser-widget.c +++ b/gui/simple-greeter/gdm-chooser-widget.c @@ -698,12 +698,12 @@ update_chooser_visibility (GdmChooserWidget *widget) if (gdm_chooser_widget_get_number_of_items (widget) > 0) { gtk_widget_show (widget->priv->frame); + set_chooser_list_visible (widget, TRUE); } else { gtk_widget_hide (widget->priv->frame); + set_chooser_list_visible (widget, FALSE); } - set_chooser_list_visible (widget, TRUE); - widget->priv->update_visibility_idle_id = 0; return FALSE; @@ -2743,7 +2743,7 @@ gdm_chooser_widget_propagate_pending_key_events (GdmChooserWidget *widget) void gdm_chooser_widget_loaded (GdmChooserWidget *widget) { - update_chooser_visibility (widget); g_signal_emit (widget, signals[LOADED], 0); + update_chooser_visibility (widget); queue_move_cursor_to_top (widget); } diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c index ecb5601c..8397f40e 100644 --- a/gui/simple-greeter/gdm-user-chooser-widget.c +++ b/gui/simple-greeter/gdm-user-chooser-widget.c @@ -595,7 +595,6 @@ on_is_loaded_changed (GdmUserManager *manager, GdmUserChooserWidget *widget) { GSList *users; - gboolean list_visible; /* FIXME: handle is-loaded=FALSE */ @@ -606,12 +605,6 @@ on_is_loaded_changed (GdmUserManager *manager, widget->priv->users_to_add = g_slist_concat (widget->priv->users_to_add, g_slist_copy (users)); queue_add_users (widget); - - g_object_get (G_OBJECT (widget), "list-visible", &list_visible, NULL); - - if (list_visible) { - gtk_widget_grab_focus (GTK_WIDGET (widget)); - } } static void @@ -962,6 +955,19 @@ setup_icons (GdmUserChooserWidget *widget) } static void +on_list_visible_changed (GdmChooserWidget *widget, + GParamSpec *pspec, + gpointer data) +{ + gboolean is_visible; + + g_object_get (G_OBJECT (widget), "list-visible", &is_visible, NULL); + if (is_visible) { + gtk_widget_grab_focus (GTK_WIDGET (widget)); + } +} + +static void gdm_user_chooser_widget_init (GdmUserChooserWidget *widget) { widget->priv = GDM_USER_CHOOSER_WIDGET_GET_PRIVATE (widget); @@ -971,6 +977,11 @@ gdm_user_chooser_widget_init (GdmUserChooserWidget *widget) gdm_chooser_widget_set_in_use_message (GDM_CHOOSER_WIDGET (widget), _("Currently logged in")); + g_signal_connect (widget, + "notify::list-visible", + G_CALLBACK (on_list_visible_changed), + NULL); + setup_icons (widget); } |