summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-04-11 06:18:18 +0000
committerRay Strode <halfline@src.gnome.org>2008-04-11 06:18:18 +0000
commit1a681c60a4af97f3e84ecf5185258aa5c96c7c0b (patch)
tree79657ee4565669248f4ab02c4b217b92b9778810
parent49f038386275f2724bfcd4803c4302876162afa7 (diff)
downloadgdm-1a681c60a4af97f3e84ecf5185258aa5c96c7c0b.tar.gz
Redo focus handling so that tabing out of the list works
2008-04-11 Ray Strode <rstrode@redhat.com> * gui/simple-greeter/gdm-chooser-widget.c (gdm_chooser_widget_grab_focus), (gdm_chooser_widget_focus), (gdm_chooser_widget_focus_in_event), (gdm_chooser_widget_class_init): Redo focus handling so that tabing out of the list works svn path=/trunk/; revision=6141
-rw-r--r--ChangeLog10
-rw-r--r--gui/simple-greeter/gdm-chooser-widget.c33
2 files changed, 39 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index fb297161..82d985d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-11 Ray Strode <rstrode@redhat.com>
+
+ * gui/simple-greeter/gdm-chooser-widget.c
+ (gdm_chooser_widget_grab_focus), (gdm_chooser_widget_focus),
+ (gdm_chooser_widget_focus_in_event),
+ (gdm_chooser_widget_class_init):
+ Redo focus handling so that tabing out of the list works
+
2008-04-09 William Jon McCann <jmccann@redhat.com>
* gui/simple-greeter/gdm-user.c: (on_icon_monitor_changed),
@@ -32,7 +40,7 @@
* data/Makefile.am:
* daemon/Makefile.am:
* daemon/gdm-display-access-file.c
- (_create_xauth_file_for_user)
+ (_create_xauth_file_for_user):
Store X auth password in /var/run/gdm instead of /tmp
2008-04-07 Ray Strode <rstrode@redhat.com>
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index 7899621a..d21c6a32 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -965,10 +965,36 @@ gdm_chooser_widget_size_allocate (GtkWidget *widget,
}
}
-static void
-gdm_chooser_widget_grab_focus (GtkWidget *widget)
+static gboolean
+gdm_chooser_widget_focus (GtkWidget *widget,
+ GtkDirectionType direction)
+{
+ /* Since we only have one focusable child (the tree view),
+ * no matter which direction we're going the rules are the
+ * same:
+ *
+ * 1) if it's aready got focus, return FALSE to surrender
+ * that focus.
+ * 2) if it doesn't already have focus, then grab it
+ */
+ if (GTK_CONTAINER (widget)->focus_child != NULL) {
+ return FALSE;
+ }
+
+ gtk_widget_grab_focus (GDM_CHOOSER_WIDGET (widget)->priv->items_view);
+ return TRUE;
+}
+
+static gboolean
+gdm_chooser_widget_focus_in_event (GtkWidget *widget,
+ GdkEventFocus *focus_event)
{
+ /* We don't ever want the chooser widget itself to have focus.
+ * Focus should always go to the tree view.
+ */
gtk_widget_grab_focus (GDM_CHOOSER_WIDGET (widget)->priv->items_view);
+
+ return FALSE;
}
static void
@@ -984,7 +1010,8 @@ gdm_chooser_widget_class_init (GdmChooserWidgetClass *klass)
widget_class->size_allocate = gdm_chooser_widget_size_allocate;
widget_class->hide = gdm_chooser_widget_hide;
widget_class->show = gdm_chooser_widget_show;
- widget_class->grab_focus = gdm_chooser_widget_grab_focus;
+ widget_class->focus = gdm_chooser_widget_focus;
+ widget_class->focus_in_event = gdm_chooser_widget_focus_in_event;
signals [ACTIVATED] = g_signal_new ("activated",
G_TYPE_FROM_CLASS (object_class),