/* 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, twin;
+ static Window lastwin = None, curwin = None;
+#if 0
+ Window twin;
+#endif
Window childwin = gdk_root_window;
int x, y, ox, oy;
curwin = gdk_root_window;
ox = x = xevent->xmotion.x_root;
oy = y = xevent->xmotion.y_root;
+#if 1
+ curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
+ xevent->xmotion.y_root,
+ gdk_dnd.c->xids);
+ XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
+ x, y, &x, &y, &childwin);
+#else
while(childwin != None)
{
ox = x; oy = y;
x, y, &x, &y, &twin);
}
}
+#endif
GDK_NOTE (DND,
g_print("Drag is now in window %#lx, lastwin was %#lx, ddc = %#lx\n",
curwin, lastwin, gdk_dnd.dnd_drag_curwin));
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
}
gdk_dnd.c->drag_pm_default = gdk_dnd.c->drag_pm_ok = NULL;
+ g_list_free(gdk_dnd.c->xids);
+ gdk_dnd.c->xids = NULL;
}
gdk_dnd_display_drag_cursor(-1, -1,
gdk_dnd.dnd_drag_target?TRUE:FALSE,
{
g_return_if_fail(default_pixmapwin != NULL);
+ g_list_free(gdk_dnd.c->xids); gdk_dnd.c->xids = NULL;
if(gdk_dnd.c->drag_pm_default)
gdk_window_unref(gdk_dnd.c->drag_pm_default);
if(gdk_dnd.c->drag_pm_ok)
gdk_window_ref(default_pixmapwin);
gdk_dnd.c->drag_pm_default = default_pixmapwin;
gdk_dnd.c->default_hotspot = *default_hotspot;
+ gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, ((GdkWindowPrivate *)default_pixmapwin)->xwindow);
if(goahead_pixmapwin)
{
gdk_window_ref(goahead_pixmapwin);
+ gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, ((GdkWindowPrivate *)goahead_pixmapwin)->xwindow);
gdk_dnd.c->drag_pm_ok = goahead_pixmapwin;
gdk_dnd.c->ok_hotspot = *goahead_hotspot;
}
Atom gdk_wm_window_protocols[2];
Atom gdk_selection_property;
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
- {0,0}, {0,0}};
+ {0,0}, {0,0}, NULL};
GdkDndGlobals gdk_dnd = {None,None,None,
None,None,None,
None,
Cursor gdk_cursor_dragdefault, gdk_cursor_dragok;
GdkWindow *drag_pm_default, *drag_pm_ok;
GdkPoint default_hotspot, ok_hotspot;
+ GList *xids;
};
typedef struct _GdkDndCursorInfo GdkDndCursorInfo;
gdk_window_unref(gdk_dnd.c->drag_pm_ok);
}
gdk_dnd.c->drag_pm_default = gdk_dnd.c->drag_pm_ok = NULL;
+ g_list_free(gdk_dnd.c->xids);
+ gdk_dnd.c->xids = NULL;
}
gdk_dnd_display_drag_cursor(-1, -1,
gdk_dnd.dnd_drag_target?TRUE:FALSE,
{
g_return_if_fail(default_pixmapwin != NULL);
+ g_list_free(gdk_dnd.c->xids); gdk_dnd.c->xids = NULL;
if(gdk_dnd.c->drag_pm_default)
gdk_window_unref(gdk_dnd.c->drag_pm_default);
if(gdk_dnd.c->drag_pm_ok)
gdk_window_ref(default_pixmapwin);
gdk_dnd.c->drag_pm_default = default_pixmapwin;
gdk_dnd.c->default_hotspot = *default_hotspot;
+ gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, ((GdkWindowPrivate *)default_pixmapwin)->xwindow);
if(goahead_pixmapwin)
{
gdk_window_ref(goahead_pixmapwin);
+ gdk_dnd.c->xids = g_list_append(gdk_dnd.c->xids, ((GdkWindowPrivate *)goahead_pixmapwin)->xwindow);
gdk_dnd.c->drag_pm_ok = goahead_pixmapwin;
gdk_dnd.c->ok_hotspot = *goahead_hotspot;
}
Atom gdk_wm_window_protocols[2];
Atom gdk_selection_property;
GdkDndCursorInfo gdk_dnd_cursorinfo = {None, None, NULL, NULL,
- {0,0}, {0,0}};
+ {0,0}, {0,0}, NULL};
GdkDndGlobals gdk_dnd = {None,None,None,
None,None,None,
None,
/* 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, twin;
+ static Window lastwin = None, curwin = None;
+#if 0
+ Window twin;
+#endif
Window childwin = gdk_root_window;
int x, y, ox, oy;
curwin = gdk_root_window;
ox = x = xevent->xmotion.x_root;
oy = y = xevent->xmotion.y_root;
+#if 1
+ curwin = gdk_window_xid_at_coords(xevent->xmotion.x_root,
+ xevent->xmotion.y_root,
+ gdk_dnd.c->xids);
+ XTranslateCoordinates(gdk_display, gdk_root_window, curwin,
+ x, y, &x, &y, &childwin);
+#else
while(childwin != None)
{
ox = x; oy = y;
x, y, &x, &y, &twin);
}
}
+#endif
GDK_NOTE (DND,
g_print("Drag is now in window %#lx, lastwin was %#lx, ddc = %#lx\n",
curwin, lastwin, gdk_dnd.dnd_drag_curwin));