[nautilus] list-view: make sure not to activate items while chaining up



commit 822b99ee1de297fbe78548a1a7fa96d1be737f72
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Feb 18 10:53:55 2011 -0500

    list-view: make sure not to activate items while chaining up
    
    The event activation is done entirely in our signal handler, and
    row-activated should only be used for the typeahead search box.

 src/nautilus-list-view.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index c9e5ac5..4f4c949 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -613,6 +613,13 @@ do_popup_menu (GtkWidget *widget, NautilusListView *view, GdkEventButton *event)
 	}
 }
 
+static void
+row_activated_callback (GtkTreeView *treeview, GtkTreePath *path, 
+			GtkTreeViewColumn *column, NautilusListView *view)
+{
+	activate_selected_items (view);
+}
+
 static gboolean
 button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callback_data)
 {
@@ -769,7 +776,15 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
 			}
 		
 			if (call_parent) {
+				g_signal_handlers_block_by_func (tree_view,
+								 row_activated_callback,
+								 view);
+
 				tree_view_class->button_press_event (widget, event);
+
+				g_signal_handlers_unblock_by_func (tree_view,
+								   row_activated_callback,
+								   view);
 			} else if (gtk_tree_selection_path_is_selected (selection, path)) {
 				gtk_widget_grab_focus (widget);
 			}
@@ -961,13 +976,6 @@ row_collapsed_callback (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *p
 }
 
 static void
-row_activated_callback (GtkTreeView *treeview, GtkTreePath *path, 
-			GtkTreeViewColumn *column, NautilusListView *view)
-{
-	activate_selected_items (view);
-}
-
-static void
 subdirectory_unloaded_callback (NautilusListModel *model,
 				NautilusDirectory *directory,
 				gpointer callback_data)



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