diff options
author | Rui Matos <tiagomatos@gmail.com> | 2013-09-03 20:52:15 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2013-09-04 01:31:38 +0200 |
commit | be35af45c9556ee9cb9ab0498ae83fc8da869678 (patch) | |
tree | 7db8f6cd165378dd60b645f926d9023e6e9441f2 | |
parent | 04b24631abec3efa7050a2baaa35380ae0f55ec9 (diff) | |
download | gnome-control-center-be35af45c9556ee9cb9ab0498ae83fc8da869678.tar.gz |
shell: Make sure we don't start with a selected icon
If focus ends up in the icon view we get an ugly selection so avoid
that at least initially.
-rw-r--r-- | shell/cc-window.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/cc-window.c b/shell/cc-window.c index b91dcf3b5..3f49f64ba 100644 --- a/shell/cc-window.c +++ b/shell/cc-window.c @@ -1402,6 +1402,18 @@ gdk_window_set_cb (GObject *object, g_free (str); } +static gboolean +window_map_event_cb (GtkWidget *widget, + GdkEvent *event, + CcWindow *self) +{ + /* If focus ends up in a category icon view one of the items is + * immediately selected which looks odd when we are starting up, so + * we explicitly unset the focus here. */ + gtk_window_set_focus (GTK_WINDOW (self), NULL); + return GDK_EVENT_PROPAGATE; +} + static void create_main_page (CcWindow *self) { @@ -1535,6 +1547,7 @@ create_window (CcWindow *self) gtk_widget_add_events (GTK_WIDGET (self), GDK_BUTTON_RELEASE_MASK); g_signal_connect (self, "button-release-event", G_CALLBACK (window_button_release_event), self); + g_signal_connect (self, "map-event", G_CALLBACK (window_map_event_cb), self); g_signal_connect (self, "notify::window", G_CALLBACK (gdk_window_set_cb), self); |