diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-02-22 18:44:55 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-02-22 19:10:16 -0500 |
commit | 7c1cfc5533d68655b001936168d8a5c2a6f7622b (patch) | |
tree | 478a4a3eca37b75c2629b1886656509c24622f37 | |
parent | 14122d1acbcbc43e093758df17409b1564dc81bb (diff) | |
download | gtk+-7c1cfc5533d68655b001936168d8a5c2a6f7622b.tar.gz |
x11: Fix dnd coordinate handling
We were not properly converting the coordinates we
got to root coordinates. This was showing up as offsets
between the actual drop target and the area where drops
can happen, e.g. when dragging over a stack switcher
to switch pages.
-rw-r--r-- | gdk/x11/gdkdrag-x11.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index c2bd36682a..04fa753fa3 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -2073,8 +2073,12 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface, precache_target_list (drag); gdk_device_get_position (device, &px, &py); - x_root = round (px) + dx; - y_root = round (py) + dy; + + gdk_x11_surface_get_root_coords (surface, + round (px) + dx, + round (py) + dy, + &x_root, + &y_root); x11_drag->start_x = x_root; x11_drag->start_y = y_root; |