=?WINDOWS-1252?Q?[PATCH]_Bug_347423_=96_double-cli?= =?WINDOWS-1252?Q?ck_doesn't_open_half-shown_items?=



Hello Nautilus crew!, I've attached a new patch in http://bugs.gnome.org/347423 , for convenience I'm also attaching it to this email, hope the mentor of the patch can review and apply it :), in order to this submarine to work better :)

Regards
Index: libnautilus-private/nautilus-icon-private.h
===================================================================
--- libnautilus-private/nautilus-icon-private.h	(revisión: 14075)
+++ libnautilus-private/nautilus-icon-private.h	(copia de trabajo)
@@ -274,6 +274,9 @@
 	GtkWidget *search_entry;
 	guint search_entry_changed_id;
 	guint typeselect_flush_timeout;
+
+	/* Needed for dblclicking activation of partially shown icons, see bug #347423 */
+	gboolean icon_revealed;
 };
 
 /* Private functions shared by mutiple files. */
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
--- libnautilus-private/nautilus-icon-container.c	(revisión: 14075)
+++ libnautilus-private/nautilus-icon-container.c	(copia de trabajo)
@@ -3426,6 +3426,31 @@
 	}
 }
 
+static gboolean
+clicked_within_double_click_interval (NautilusIconContainer *container)
+{
+	static gint64 last_click_time = 0;
+	static gint click_count = 0;
+	gint double_click_time;
+	gint64 current_time;
+			
+	/* Determine click count */
+	g_object_get (G_OBJECT (gtk_widget_get_settings (GTK_WIDGET (container))), 
+		      "gtk-double-click-time", &double_click_time,
+		      NULL);
+	current_time = eel_get_system_time ();
+	if (current_time - last_click_time < double_click_time * 1000) {
+		click_count++;
+	} else {
+		click_count = 0;
+	}
+	
+	/* Stash time for next compare */
+	last_click_time = current_time;
+
+	return (click_count > 0);
+}
+
 static void
 clear_drag_state (NautilusIconContainer *container)
 {
@@ -5180,8 +5205,9 @@
 		details->double_click_icon[1] = details->double_click_icon[0];
 		details->double_click_icon[0] = icon;
 	}
-	if (event->type == GDK_2BUTTON_PRESS &&
-	    (event->button == DRAG_BUTTON || event->button == MIDDLE_BUTTON)) {
+	if ((event->type == GDK_2BUTTON_PRESS &&
+	    (event->button == DRAG_BUTTON || event->button == MIDDLE_BUTTON))
+	    || (!details->single_click_mode && clicked_within_double_click_interval(container) && details->icon_revealed)) {
 		/* Double clicking does not trigger a D&D action. */
 		details->drag_button = 0;
 		details->drag_icon = NULL;
@@ -5198,6 +5224,7 @@
 				activate_selected_items_alternate (container, icon);
 			}
 		}
+		details->icon_revealed = FALSE;
 		return TRUE;
 	}
 	if (event->button == DRAG_BUTTON
@@ -5246,6 +5273,7 @@
 				       signals[SELECTION_CHANGED], 0);
 		} else {
 			select_one_unselect_others (container, icon);
+			details->icon_revealed = TRUE;
 			g_signal_emit (container,
 				       signals[SELECTION_CHANGED], 0);
 		}


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