diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-23 17:18:55 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-24 20:49:08 -0400 |
commit | 3d37f08f38c10923cc8b1e5fcc999b8b76d75533 (patch) | |
tree | 2a082260ca105447b633d1af8d1ac0c2969b6ba1 /gdk/x11/gdkdrag-x11.c | |
parent | 160f1e581aa100378691da135cc99b2c11c82cc1 (diff) | |
download | gtk+-3d37f08f38c10923cc8b1e5fcc999b8b76d75533.tar.gz |
Remove gdk_device_warp
This was only ever implemented on X11, and is
not something we want to encourage apps to do, ever.
Diffstat (limited to 'gdk/x11/gdkdrag-x11.c')
-rw-r--r-- | gdk/x11/gdkdrag-x11.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index 57fff0c696..db2abcdc5c 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -41,6 +41,7 @@ #include "gdkselectioninputstream-x11.h" #include "gdkselectionoutputstream-x11.h" +#include <math.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xatom.h> @@ -2342,9 +2343,22 @@ gdk_dnd_handle_key_event (GdkDrag *drag, if (dx != 0 || dy != 0) { + GdkDisplay *display; + Display *xdisplay; + GdkX11Screen *screen; + Window dest; + x11_drag->last_x += dx; x11_drag->last_y += dy; - gdk_device_warp (pointer, x11_drag->last_x, x11_drag->last_y); + + display = gdk_event_get_display ((GdkEvent *)event); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + screen = GDK_X11_DISPLAY (display)->screen; + dest = GDK_SCREEN_XROOTWIN (screen); + + XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, + round (x11_drag->last_x * screen->surface_scale), + round (x11_drag->last_y * screen->surface_scale)); } gdk_drag_update (drag, x11_drag->last_x, x11_drag->last_y, state, |