summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-01-12 18:38:46 +0100
committerRay Strode <rstrode@redhat.com>2011-02-07 09:45:52 -0500
commit00612f5f8288a37ee5159c969030661d2edd14c4 (patch)
tree0c274158afc02890ea510745dbfdec9d2fc42b0a /gui
parent587a24827fb0da74a86ff9b42a44a989a0a7aade (diff)
downloadgdm-00612f5f8288a37ee5159c969030661d2edd14c4.tar.gz
Correctly give focus to the user chooser on startup
We manually handle how focus works in the GdmChooserWidget container, and we try to automatically move the focus to the treeview inside the chooser. However, it fails the first time because the treeview is not realized yet and the logic in the code assumes that if focus moved to the chooser, it moved to the treeview, so later attempt to get the focus grabbed by the treeview are just ignored. It works fine when using gtk_widget_child_focus() to give the focus to the treeview. And this makes more sense since the chooser is a container anyway. https://bugzilla.gnome.org/show_bug.cgi?id=629310
Diffstat (limited to 'gui')
-rw-r--r--gui/simple-greeter/gdm-chooser-widget.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index db2d9b2d..ebbfdb9e 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -910,17 +910,13 @@ _grab_focus (GtkWidget *widget)
foc_widget = GDM_CHOOSER_WIDGET (widget)->priv->items_view;
g_debug ("GdmChooserWidget: grabbing focus");
- if (! gtk_widget_get_realized (foc_widget)) {
- g_debug ("GdmChooserWidget: not grabbing focus - not realized");
- return;
- }
if (gtk_widget_has_focus (foc_widget)) {
g_debug ("GdmChooserWidget: not grabbing focus - already has it");
return;
}
- gtk_widget_grab_focus (foc_widget);
+ gtk_widget_child_focus (foc_widget, GTK_DIR_TAB_FORWARD);
}
static void