[gnome-control-center] shell: Fix search result activation on Return key press



commit 5357cdea8a9e89bb01a856ef6ece3401badba9bf
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Jan 30 08:41:20 2013 +0100

    shell: Fix search result activation on Return key press
    
    'search_view' isn't a GtkIconView anymore and the row-activated
    handler relies on having the selection set to the proper row to
    activate it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692821

 shell/gnome-control-center.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 054e447..064776c 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -638,11 +638,21 @@ search_entry_key_press_event_cb (GtkEntry    *entry,
   if (event->keyval == GDK_KEY_Return)
     {
       GtkTreePath *path;
+      GtkTreeSelection *selection;
 
       path = gtk_tree_path_new_first ();
 
-      gtk_icon_view_item_activated (GTK_ICON_VIEW (priv->search_view), path);
+      selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->search_view));
+      gtk_tree_selection_select_path (selection, path);
+
+      if (!gtk_tree_selection_path_is_selected (selection, path))
+        {
+          gtk_tree_path_free (path);
+          return FALSE;
+        }
 
+      gtk_tree_view_row_activated (GTK_TREE_VIEW (priv->search_view), path,
+                                   gtk_tree_view_get_column (GTK_TREE_VIEW (priv->search_view), 0));
       gtk_tree_path_free (path);
       return TRUE;
     }



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