summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-05-17 19:27:00 +0200
committerCarlos Garnacho <carlosg@gnome.org>2016-05-18 13:09:55 +0200
commitaec4dbfa9445e94fba7250540f1aece223cd64c5 (patch)
tree59c4c00a52d1a44936005ccda47d49b03b3fb284
parentd1585a7a60d760a0c98934f970c4403023a399c3 (diff)
downloadgtk+-aec4dbfa9445e94fba7250540f1aece223cd64c5.tar.gz
x11/dnd: Ignore grab broken events from other devices than our DnD device.
The GdkDragContext should only listen to GDK_GRAB_BROKEN events sent to its own pointer device. It turns out that the passive key grabs mistake GDK into sending a GdkEventGrabBroken on the master keyboard, which the DnD machinery mistakes as a signal to cancel the operation. https://bugzilla.gnome.org/show_bug.cgi?id=766442
-rw-r--r--gdk/x11/gdkdnd-x11.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index c433b173ab..439981853c 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -3042,6 +3042,10 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context,
event->grab_window == x11_context->ipc_window)
return FALSE;
+ if (gdk_event_get_device ((GdkEvent *) event) !=
+ gdk_drag_context_get_device (context))
+ return FALSE;
+
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
return TRUE;
}