Commit 8715d1c1 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Accept drops that are sent to a toplevel but are not within the toplevels

Wed Nov 18 11:54:57 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
	that are sent to a toplevel but are not within the
	toplevels bounds.

	* gdk/gdkdnd.c gdk/gdk.h: Added support for a
	XdndProxy atom which proxies the drag to another window.
parent fb6a7ccb
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
Wed Nov 18 11:54:57 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_find_widget): Accept drops
that are sent to a toplevel but are not within the
toplevels bounds.
* gdk/gdkdnd.c gdk/gdk.h: Added support for a
XdndProxy atom which proxies the drag to another window.
Tue Nov 17 1998 The Rasterman <raster@redhat.com> Tue Nov 17 1998 The Rasterman <raster@redhat.com>
* gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin * gdk/gdk.h, gdk/gdkwindow.c: Added gdk_window_get_deskrelative_origin
function to correctly determine gdk window position relative to function to correctly determine gdk window position relative to
...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org> ...@@ -81,8 +90,7 @@ Tue Nov 17 00:06:29 1998 Lars Hamann <lars@gtk.org>
Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com> Mon Nov 16 15:10:33 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Optimizations for moving point n * gtk/gtktext.c: Optimizations for [advance/decrement]_mark_n.
places.
(gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>) (gtk-mailund-980718-0, Thomas Mailund Jensen <mailund@daimi.aau.dk>)
* gtk/gtkfixed.c: Removed gtk_fixed_umap, which was * gtk/gtkfixed.c: Removed gtk_fixed_umap, which was
......
...@@ -245,7 +245,7 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context); ...@@ -245,7 +245,7 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context);
GdkDragContext * gdk_drag_begin (GdkWindow *window, GdkDragContext * gdk_drag_begin (GdkWindow *window,
GList *targets, GList *targets,
GdkDragAction actions); GdkDragAction actions);
gboolean gdk_drag_get_protocol (guint32 xid, guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol); GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context, void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window, GdkWindow *drag_window,
......
...@@ -1214,7 +1214,7 @@ motif_set_targets (GdkDragContext *context) ...@@ -1214,7 +1214,7 @@ motif_set_targets (GdkDragContext *context)
private->motif_targets_set = 1; private->motif_targets_set = 1;
} }
gboolean guint32
motif_check_dest (Window win) motif_check_dest (Window win)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
...@@ -1251,7 +1251,7 @@ motif_check_dest (Window win) ...@@ -1251,7 +1251,7 @@ motif_check_dest (Window win)
XFree (info); XFree (info);
} }
return retval; return retval ? win : GDK_NONE;
} }
...@@ -2098,7 +2098,7 @@ xdnd_send_motion (GdkDragContext *context, ...@@ -2098,7 +2098,7 @@ xdnd_send_motion (GdkDragContext *context,
private->drag_status = GDK_DRAG_STATUS_MOTION_WAIT; private->drag_status = GDK_DRAG_STATUS_MOTION_WAIT;
} }
static gboolean static guint32
xdnd_check_dest (Window win) xdnd_check_dest (Window win)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
...@@ -2106,17 +2106,51 @@ xdnd_check_dest (Window win) ...@@ -2106,17 +2106,51 @@ xdnd_check_dest (Window win)
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
GdkAtom *version; GdkAtom *version;
Window *proxy_data;
Window proxy;
static GdkAtom xdnd_proxy_atom = GDK_NONE;
gint old_warnings = gdk_error_warnings;
if (!xdnd_proxy_atom)
xdnd_proxy_atom = gdk_atom_intern ("XdndProxy", FALSE);
if (!xdnd_aware_atom) if (!xdnd_aware_atom)
xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE); xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE);
proxy = GDK_NONE;
gdk_error_code = 0;
gdk_error_warnings = 0;
XGetWindowProperty (gdk_display, win, XGetWindowProperty (gdk_display, win,
xdnd_proxy_atom, 0,
1, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&proxy_data);
if (!gdk_error_code)
{
if (type != None)
{
if ((format == 32) && (nitems == 1))
{
proxy = *proxy_data;
}
else
GDK_NOTE (DND,
g_warning ("Invalid XdndOwner property on window %ld\n", win));
XFree (proxy_data);
}
XGetWindowProperty (gdk_display, proxy ? proxy : win,
xdnd_aware_atom, 0, xdnd_aware_atom, 0,
1, False, AnyPropertyType, 1, False, AnyPropertyType,
&type, &format, &nitems, &after, &type, &format, &nitems, &after,
(guchar **)&version); (guchar **)&version);
if (type != None) if (!gdk_error_code && type != None)
{ {
if ((format == 32) && (nitems == 1)) if ((format == 32) && (nitems == 1))
{ {
...@@ -2130,7 +2164,12 @@ xdnd_check_dest (Window win) ...@@ -2130,7 +2164,12 @@ xdnd_check_dest (Window win)
XFree (version); XFree (version);
} }
return retval; }
gdk_error_warnings = old_warnings;
gdk_error_code = 0;
return retval ? (proxy ? proxy : win) : GDK_NONE;
} }
/* Target side */ /* Target side */
...@@ -2423,21 +2462,23 @@ gdk_drag_begin (GdkWindow *window, ...@@ -2423,21 +2462,23 @@ gdk_drag_begin (GdkWindow *window,
return new_context; return new_context;
} }
gboolean guint32
gdk_drag_get_protocol (guint32 xid, gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol) GdkDragProtocol *protocol)
{ {
if (xdnd_check_dest (xid)) guint32 retval;
if ((retval = xdnd_check_dest (xid)))
{ {
*protocol = GDK_DRAG_PROTO_XDND; *protocol = GDK_DRAG_PROTO_XDND;
GDK_NOTE (DND, g_message ("Entering dnd window %#x\n", xid)); GDK_NOTE (DND, g_message ("Entering dnd window %#x\n", xid));
return TRUE; return retval;
} }
else if (motif_check_dest (xid)) else if ((retval = motif_check_dest (xid)))
{ {
*protocol = GDK_DRAG_PROTO_MOTIF; *protocol = GDK_DRAG_PROTO_MOTIF;
GDK_NOTE (DND, g_message ("Entering motif window %#x\n", xid)); GDK_NOTE (DND, g_message ("Entering motif window %#x\n", xid));
return TRUE; return retval;
} }
else else
{ {
...@@ -2491,11 +2532,11 @@ gdk_drag_get_protocol (guint32 xid, ...@@ -2491,11 +2532,11 @@ gdk_drag_get_protocol (guint32 xid,
if (rootwin) if (rootwin)
{ {
*protocol = GDK_DRAG_PROTO_ROOTWIN; *protocol = GDK_DRAG_PROTO_ROOTWIN;
return TRUE; return xid;
} }
} }
return FALSE; return GDK_NONE;
} }
void void
...@@ -2519,17 +2560,18 @@ gdk_drag_find_window (GdkDragContext *context, ...@@ -2519,17 +2560,18 @@ gdk_drag_find_window (GdkDragContext *context,
if (private->dest_xid != dest) if (private->dest_xid != dest)
{ {
Window recipient;
private->dest_xid = dest; private->dest_xid = dest;
/* Check if new destination accepts drags, and which protocol */ /* Check if new destination accepts drags, and which protocol */
if (gdk_drag_get_protocol (dest, protocol)) if ((recipient = gdk_drag_get_protocol (dest, protocol)))
{ {
*dest_window = gdk_window_lookup (dest); *dest_window = gdk_window_lookup (recipient);
if (*dest_window) if (*dest_window)
gdk_window_ref (*dest_window); gdk_window_ref (*dest_window);
else else
*dest_window = gdk_window_foreign_new (dest); *dest_window = gdk_window_foreign_new (recipient);
} }
else else
*dest_window = NULL; *dest_window = NULL;
......
...@@ -1214,7 +1214,7 @@ motif_set_targets (GdkDragContext *context) ...@@ -1214,7 +1214,7 @@ motif_set_targets (GdkDragContext *context)
private->motif_targets_set = 1; private->motif_targets_set = 1;
} }
gboolean guint32
motif_check_dest (Window win) motif_check_dest (Window win)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
...@@ -1251,7 +1251,7 @@ motif_check_dest (Window win) ...@@ -1251,7 +1251,7 @@ motif_check_dest (Window win)
XFree (info); XFree (info);
} }
return retval; return retval ? win : GDK_NONE;
} }
...@@ -2098,7 +2098,7 @@ xdnd_send_motion (GdkDragContext *context, ...@@ -2098,7 +2098,7 @@ xdnd_send_motion (GdkDragContext *context,
private->drag_status = GDK_DRAG_STATUS_MOTION_WAIT; private->drag_status = GDK_DRAG_STATUS_MOTION_WAIT;
} }
static gboolean static guint32
xdnd_check_dest (Window win) xdnd_check_dest (Window win)
{ {
gboolean retval = FALSE; gboolean retval = FALSE;
...@@ -2106,17 +2106,51 @@ xdnd_check_dest (Window win) ...@@ -2106,17 +2106,51 @@ xdnd_check_dest (Window win)
int format; int format;
unsigned long nitems, after; unsigned long nitems, after;
GdkAtom *version; GdkAtom *version;
Window *proxy_data;
Window proxy;
static GdkAtom xdnd_proxy_atom = GDK_NONE;
gint old_warnings = gdk_error_warnings;
if (!xdnd_proxy_atom)
xdnd_proxy_atom = gdk_atom_intern ("XdndProxy", FALSE);
if (!xdnd_aware_atom) if (!xdnd_aware_atom)
xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE); xdnd_aware_atom = gdk_atom_intern ("XdndAware", FALSE);
proxy = GDK_NONE;
gdk_error_code = 0;
gdk_error_warnings = 0;
XGetWindowProperty (gdk_display, win, XGetWindowProperty (gdk_display, win,
xdnd_proxy_atom, 0,
1, False, AnyPropertyType,
&type, &format, &nitems, &after,
(guchar **)&proxy_data);
if (!gdk_error_code)
{
if (type != None)
{
if ((format == 32) && (nitems == 1))
{
proxy = *proxy_data;
}
else
GDK_NOTE (DND,
g_warning ("Invalid XdndOwner property on window %ld\n", win));
XFree (proxy_data);
}
XGetWindowProperty (gdk_display, proxy ? proxy : win,
xdnd_aware_atom, 0, xdnd_aware_atom, 0,
1, False, AnyPropertyType, 1, False, AnyPropertyType,
&type, &format, &nitems, &after, &type, &format, &nitems, &after,
(guchar **)&version); (guchar **)&version);
if (type != None) if (!gdk_error_code && type != None)
{ {
if ((format == 32) && (nitems == 1)) if ((format == 32) && (nitems == 1))
{ {
...@@ -2130,7 +2164,12 @@ xdnd_check_dest (Window win) ...@@ -2130,7 +2164,12 @@ xdnd_check_dest (Window win)
XFree (version); XFree (version);
} }
return retval; }
gdk_error_warnings = old_warnings;
gdk_error_code = 0;
return retval ? (proxy ? proxy : win) : GDK_NONE;
} }
/* Target side */ /* Target side */
...@@ -2423,21 +2462,23 @@ gdk_drag_begin (GdkWindow *window, ...@@ -2423,21 +2462,23 @@ gdk_drag_begin (GdkWindow *window,
return new_context; return new_context;
} }
gboolean guint32
gdk_drag_get_protocol (guint32 xid, gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol) GdkDragProtocol *protocol)
{ {
if (xdnd_check_dest (xid)) guint32 retval;
if ((retval = xdnd_check_dest (xid)))
{ {
*protocol = GDK_DRAG_PROTO_XDND; *protocol = GDK_DRAG_PROTO_XDND;
GDK_NOTE (DND, g_message ("Entering dnd window %#x\n", xid)); GDK_NOTE (DND, g_message ("Entering dnd window %#x\n", xid));
return TRUE; return retval;
} }
else if (motif_check_dest (xid)) else if ((retval = motif_check_dest (xid)))
{ {
*protocol = GDK_DRAG_PROTO_MOTIF; *protocol = GDK_DRAG_PROTO_MOTIF;
GDK_NOTE (DND, g_message ("Entering motif window %#x\n", xid)); GDK_NOTE (DND, g_message ("Entering motif window %#x\n", xid));
return TRUE; return retval;
} }
else else
{ {
...@@ -2491,11 +2532,11 @@ gdk_drag_get_protocol (guint32 xid, ...@@ -2491,11 +2532,11 @@ gdk_drag_get_protocol (guint32 xid,
if (rootwin) if (rootwin)
{ {
*protocol = GDK_DRAG_PROTO_ROOTWIN; *protocol = GDK_DRAG_PROTO_ROOTWIN;
return TRUE; return xid;
} }
} }
return FALSE; return GDK_NONE;
} }
void void
...@@ -2519,17 +2560,18 @@ gdk_drag_find_window (GdkDragContext *context, ...@@ -2519,17 +2560,18 @@ gdk_drag_find_window (GdkDragContext *context,
if (private->dest_xid != dest) if (private->dest_xid != dest)
{ {
Window recipient;
private->dest_xid = dest; private->dest_xid = dest;
/* Check if new destination accepts drags, and which protocol */ /* Check if new destination accepts drags, and which protocol */
if (gdk_drag_get_protocol (dest, protocol)) if ((recipient = gdk_drag_get_protocol (dest, protocol)))
{ {
*dest_window = gdk_window_lookup (dest); *dest_window = gdk_window_lookup (recipient);
if (*dest_window) if (*dest_window)
gdk_window_ref (*dest_window); gdk_window_ref (*dest_window);
else else
*dest_window = gdk_window_foreign_new (dest); *dest_window = gdk_window_foreign_new (recipient);
} }
else else
*dest_window = NULL; *dest_window = NULL;
......
...@@ -121,6 +121,7 @@ struct _GtkDragFindData { ...@@ -121,6 +121,7 @@ struct _GtkDragFindData {
GdkDragContext *context; GdkDragContext *context;
GtkDragDestInfo *info; GtkDragDestInfo *info;
gboolean found; gboolean found;
gboolean toplevel;
gboolean (*callback) (GtkWidget *widget, GdkDragContext *context, gboolean (*callback) (GtkWidget *widget, GdkDragContext *context,