forked from AuroraMiddleware/gtk
DnD works again, fixed my own stupidity ;-)
This commit is contained in:
parent
6824581335
commit
1cf3f510d1
14
gdk/gdk.c
14
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)
|
||||
{
|
||||
ox = x; oy = y;
|
||||
curwin = childwin;
|
||||
XTranslateCoordinates(gdk_display, 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",
|
||||
|
@ -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)
|
||||
{
|
||||
ox = x; oy = y;
|
||||
curwin = childwin;
|
||||
XTranslateCoordinates(gdk_display, 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",
|
||||
|
Loading…
Reference in New Issue
Block a user