wayland: Fix toplevel lookup before starting DnD

We use the high-level gdk_device_get_window_at_position() to figure
out the window, although this one actually tries to find out the
current window under the device coordinates, which might well fall
outside the window, so NULL is returned in those cases.

Fix this by using the lower level _gdk_device_window_at_position()
that will return the toplevel without further lookups, so is more
desirable here.

https://bugzilla.gnome.org/show_bug.cgi?id=758250
This commit is contained in:
Carlos Garnacho
2015-11-19 20:26:11 +01:00
parent e3012dc9b3
commit ec65c6d1ce

View File

@ -25,6 +25,8 @@
#include "gdkprivate-wayland.h"
#include "gdkdisplay-wayland.h"
#include "gdkdeviceprivate.h"
#include <string.h>
#define GDK_TYPE_WAYLAND_DRAG_CONTEXT (gdk_wayland_drag_context_get_type ())
@ -350,7 +352,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
GdkWindow *toplevel;
GList *l;
toplevel = gdk_device_get_window_at_position (device, NULL, NULL);
toplevel = _gdk_device_window_at_position (device, NULL, NULL, NULL, TRUE);
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT (context_wayland);