[gnome-control-center] shell: Make sure we don't start with a selected icon



commit be35af45c9556ee9cb9ab0498ae83fc8da869678
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Sep 3 20:52:15 2013 +0200

    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.

 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 b91dcf3..3f49f64 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);
 


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