[gtk+] wayland: Fix toplevel lookup before starting DnD



commit ec65c6d1ce8a5387016851646342d2ecc6fd7bbb
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Nov 19 20:26:11 2015 +0100

    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

 gdk/wayland/gdkdnd-wayland.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 835b6d0..6f95b07 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]