[PATCH] Fix single-click mode list view item activation



From bug 309389 [1]:

"Steps to reproduce:
1. Switch to single click mode
2. Open the / folder in a window
3. Ctrl+click to highlight a folder
4. click on the arrow next to the folder or any other folder"

The folder which belongs to the clicked expander will be activated in addition to its expansion.

The ignore_button_release is relevant if a selected item is expanded, on expansion of unselected items only the 
fm_list_view_did_not_drag stuff.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=309389

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.250
diff -u -p -r1.250 fm-list-view.c
--- src/file-manager/fm-list-view.c	20 Jun 2005 10:12:38 -0000	1.250
+++ src/file-manager/fm-list-view.c	4 Jul 2005 09:49:08 -0000
@@ -106,6 +106,8 @@ struct FMListViewDetails {
 
 	gboolean drag_started;
 
+	gboolean ignore_button_release;
+
 	gboolean row_selected_on_button_down;
 
 	/* typeahead selection state */
@@ -267,7 +269,8 @@ fm_list_view_did_not_drag (FMListView *v
 		}
 
 		if ((click_policy_auto_value == NAUTILUS_CLICK_POLICY_SINGLE)
-		    && !button_event_modifies_selection(event)) {
+		    && !button_event_modifies_selection(event)
+		    && gtk_tree_selection_path_is_selected (selection, path)) {
 			if (event->button == 1) {
 				activate_selected_items (view);
 			} else if (event->button == 2) {
@@ -515,7 +518,8 @@ button_press_callback (GtkWidget *widget
 		return TRUE;
 	}
 
-	
+	view->details->ignore_button_release = FALSE;
+
 	call_parent = TRUE;
 	allow_drag = FALSE;
 	if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
@@ -574,8 +578,10 @@ button_press_callback (GtkWidget *widget
 						"expander-size", &expander_size,
 						"horizontal-separator", &horizontal_separator,
 						NULL);
+
 					call_parent = (event->x <= horizontal_separator / 2 +
 						gtk_tree_path_get_depth (path) * expander_size);
+					view->details->ignore_button_release = call_parent;
 				} else if  ((event->state & GDK_CONTROL_MASK) != 0) {
 					call_parent = FALSE;
 					gtk_tree_selection_select_path (selection, path);
@@ -636,7 +642,8 @@ button_release_callback (GtkWidget *widg
 
 	if (event->button == view->details->drag_button) {
 		stop_drag_check (view);
-		if (!view->details->drag_started) {
+		if (!view->details->drag_started &&
+		    !view->details->ignore_button_release) {
 			fm_list_view_did_not_drag (view, event);
 		}
 	}

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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