DnD works again, fixed my own stupidity ;-)

This commit is contained in:
Elliot Lee 1997-12-18 23:03:26 +00:00
parent 6824581335
commit 1cf3f510d1
2 changed files with 26 additions and 10 deletions

View 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",

View 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",