diff options
author | Benjamin Otte <otte@redhat.com> | 2017-12-11 00:55:56 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-12-11 01:02:31 +0100 |
commit | 218efa62ef7e7ee20ca70c8c0735400684561838 (patch) | |
tree | d9440ef2b2ced1c6c4ef2f187012dc0664f0729b /gdk/x11/gdkdnd-x11.c | |
parent | a7c3c794df0fa9eee47fea499f7daef48a05c167 (diff) | |
download | gtk+-218efa62ef7e7ee20ca70c8c0735400684561838.tar.gz |
dnd: Pass dx/dy instead of x_root/y_root
This way, we don't need root coordinates when computing the dnd start
position.
Diffstat (limited to 'gdk/x11/gdkdnd-x11.c')
-rw-r--r-- | gdk/x11/gdkdnd-x11.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 9b626e2ad1..1f9acd257f 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -2101,10 +2101,11 @@ GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window, GdkDevice *device, GdkContentFormats *formats, - gint x_root, - gint y_root) + gint dx, + gint dy) { GdkDragContext *context; + int x_root, y_root; context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, "display", gdk_window_get_display (window), @@ -2120,6 +2121,9 @@ _gdk_x11_window_drag_begin (GdkWindow *window, context->actions = 0; gdk_drag_context_set_device (context, device); + gdk_device_get_position (device, &x_root, &y_root); + x_root += dx; + y_root += dy; GDK_X11_DRAG_CONTEXT (context)->start_x = x_root; GDK_X11_DRAG_CONTEXT (context)->start_y = y_root; |