From 1cf3f510d1e49bcf26b016d61e42dd51c1d1a42f Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Thu, 18 Dec 1997 23:03:26 +0000 Subject: [PATCH] DnD works again, fixed my own stupidity ;-) --- gdk/gdk.c | 18 +++++++++++++----- gdk/x11/gdkmain-x11.c | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/gdk/gdk.c b/gdk/gdk.c index 3b4d22573a..46d512adda 100644 --- 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", diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 3b4d22573a..46d512adda 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",