summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-11-03 17:06:38 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-11-03 17:06:38 +0000
commit669d068594e9882226ccd721d5c3bba508ca5d03 (patch)
tree804005a2bdd2cde7beb8a1e3f2883d782946785b /gdk
parent253f6836e70f370c187830b325b6cfc4b14512a7 (diff)
downloadgdk-pixbuf-669d068594e9882226ccd721d5c3bba508ca5d03.tar.gz
Handle the case that the protocol version in the context is not set yet.
2004-11-03 Matthias Clasen <mclasen@redhat.com> * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the case that the protocol version in the context is not set yet. (#157123, James Henstridge)
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdnd-x11.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 5eb2cd7dd..4a7a59985 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -3231,7 +3231,27 @@ gdk_drag_motion (GdkDragContext *context,
if (private->old_actions != possible_actions)
private->xdnd_actions_set = FALSE;
-
+
+ if (protocol == GDK_DRAG_PROTO_XDND && private->version == 0)
+ {
+ /* This ugly hack is necessary since GTK+ doesn't know about
+ * the XDND protocol version, and in particular doesn't know
+ * that gdk_drag_find_window_for_screen() has the side-effect
+ * of setting private->version, and therefore sometimes call
+ * gdk_drag_motion() without a prior call to
+ * gdk_drag_find_window_for_screen(). This happens, e.g.
+ * when GTK+ is proxying DND events to embedded windows.
+ */
+ if (dest_window)
+ {
+ GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window);
+
+ xdnd_check_dest (display,
+ GDK_DRAWABLE_XID (dest_window),
+ &private->version);
+ }
+ }
+
/* When we have a Xdnd target, make sure our XdndActionList
* matches the current actions;
*/