]> Pileus Git - ~andy/gtk/commitdiff
DnD works again, fixed my own stupidity ;-)
authorElliot Lee <sopwith@src.gnome.org>
Thu, 18 Dec 1997 23:03:26 +0000 (23:03 +0000)
committerElliot Lee <sopwith@src.gnome.org>
Thu, 18 Dec 1997 23:03:26 +0000 (23:03 +0000)
gdk/gdk.c
gdk/x11/gdkmain-x11.c

index 3b4d22573a9d58d050779a6eb07780e76ed1d1ca..46d512addaedc7cea0d426df4a996edfa6318ea7 100644 (file)
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -1958,15 +1958,23 @@ gdk_event_translate (GdkEvent *event,
          /* XXX there has to be a better way to do this, perhaps with
             XTranslateCoordinates or XQueryTree - I don't know how,
             and this sort of works */
-         static Window lastwin = None, curwin = None;
+         static Window lastwin = None, curwin = None, twin;
          Window childwin = gdk_root_window;
-         int x, y;
+         int x, y, ox, oy;
          lastwin = curwin;
+         curwin = gdk_root_window;
+         ox = x = xevent->xmotion.x_root;
+         oy = y = xevent->xmotion.y_root;
          while(childwin != None)
            {
-             curwin = childwin;
-             XTranslateCoordinates(gdk_display, curwin, childwin,
-                               x, y, &x, &y, &childwin);
+               ox = x; oy = y;
+               curwin = childwin;
+               XTranslateCoordinates(gdk_display, curwin, curwin,
+                                       x, y, &x, &y, &childwin);
+               if(childwin != None) {
+                       XTranslateCoordinates(gdk_display, curwin, childwin,
+                                               x, y, &x, &y, &twin);
+               }
            }
 #ifdef DEBUG_DND
          g_print("Drag is now in window %#x, lastwin was %#x\n",
index 3b4d22573a9d58d050779a6eb07780e76ed1d1ca..46d512addaedc7cea0d426df4a996edfa6318ea7 100644 (file)
@@ -1958,15 +1958,23 @@ gdk_event_translate (GdkEvent *event,
          /* XXX there has to be a better way to do this, perhaps with
             XTranslateCoordinates or XQueryTree - I don't know how,
             and this sort of works */
-         static Window lastwin = None, curwin = None;
+         static Window lastwin = None, curwin = None, twin;
          Window childwin = gdk_root_window;
-         int x, y;
+         int x, y, ox, oy;
          lastwin = curwin;
+         curwin = gdk_root_window;
+         ox = x = xevent->xmotion.x_root;
+         oy = y = xevent->xmotion.y_root;
          while(childwin != None)
            {
-             curwin = childwin;
-             XTranslateCoordinates(gdk_display, curwin, childwin,
-                               x, y, &x, &y, &childwin);
+               ox = x; oy = y;
+               curwin = childwin;
+               XTranslateCoordinates(gdk_display, curwin, curwin,
+                                       x, y, &x, &y, &childwin);
+               if(childwin != None) {
+                       XTranslateCoordinates(gdk_display, curwin, childwin,
+                                               x, y, &x, &y, &twin);
+               }
            }
 #ifdef DEBUG_DND
          g_print("Drag is now in window %#x, lastwin was %#x\n",