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
This commit is contained in:
Cosimo Cecchi 2011-04-07 16:31:59 -04:00
parent d8b632765c
commit 07a6fb24fd

View file

@ -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);