[nautilus/gnome-3-0] icon-container: clear the drag state before popping up context menu



commit 6163c788418f95879a3c2e729d0e59871cb3d447
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Apr 7 16:31:59 2011 -0400

    icon-container: clear the drag state before popping up context menu
    
    Otherwise, a fake drag state will leak into the next motion-notify event
    when the menu has been dismissed, causing a segfault.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=550253

 libnautilus-private/nautilus-icon-container.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 95dd520..b025e9c 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -5320,6 +5320,9 @@ handle_popups (NautilusIconContainer *container,
 {
 	GdkEventButton button_event = { 0 };
 
+	/* ensure we clear the drag state before showing the menu */
+	clear_drag_state (container);
+
 	g_signal_emit_by_name (container, signal, &button_event);
 
 	return TRUE;
@@ -6318,6 +6321,8 @@ handle_icon_button_press (NautilusIconContainer *container,
 	}
 
 	if (event->button == CONTEXTUAL_MENU_BUTTON) {
+		clear_drag_state (container);
+
 		g_signal_emit (container,
 			       signals[CONTEXT_CLICK_SELECTION], 0,
 			       event);



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