diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1997-12-18 23:03:26 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1997-12-18 23:03:26 +0000 |
commit | 1cf3f510d1e49bcf26b016d61e42dd51c1d1a42f (patch) | |
tree | 0d8579cff94d370c8f616059b913d40d2a3beaee /gdk | |
parent | 68245813350c79799556b53baaf15a3c28a55c9a (diff) | |
download | gdk-pixbuf-1cf3f510d1e49bcf26b016d61e42dd51c1d1a42f.tar.gz |
DnD works again, fixed my own stupidity ;-)
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.c | 18 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 18 |
2 files changed, 26 insertions, 10 deletions
@@ -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", diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 3b4d22573..46d512add 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.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", |