From: Matthias Clasen Date: Mon, 30 Dec 2019 17:00:53 +0000 (-0500) Subject: wayland: Pass root coordinates for dnd events X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~477^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=15242d66e114b9121cb41cdd9961c9735934fedc;p=gtk4.git wayland: Pass root coordinates for dnd events That is what the api currently requires, so provide it. This fixes DND to work again, for the most part. --- diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 3e3d4748b2..232948a2ba 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -1296,6 +1296,7 @@ data_device_motion (void *data, wl_fixed_t y) { GdkWaylandSeat *seat = data; + int origin_x, origin_y; GDK_DISPLAY_NOTE (seat->display, EVENTS, g_message ("data device motion, data_device = %p, time = %d, x = %f, y = %f", @@ -1308,10 +1309,12 @@ data_device_motion (void *data, seat->pointer_info.surface_x = wl_fixed_to_double (x); seat->pointer_info.surface_y = wl_fixed_to_double (y); + gdk_surface_get_origin (gdk_drop_get_surface (seat->drop), &origin_x, &origin_y); + gdk_drop_emit_motion_event (seat->drop, FALSE, - seat->pointer_info.surface_x, - seat->pointer_info.surface_y, + origin_x + seat->pointer_info.surface_x, + origin_y + seat->pointer_info.surface_y, time); } @@ -1320,14 +1323,17 @@ data_device_drop (void *data, struct wl_data_device *data_device) { GdkWaylandSeat *seat = data; + int origin_x, origin_y; GDK_DISPLAY_NOTE (seat->display, EVENTS, g_message ("data device drop, data device %p", data_device)); + gdk_surface_get_origin (gdk_drop_get_surface (seat->drop), &origin_x, &origin_y); + gdk_drop_emit_drop_event (seat->drop, FALSE, - seat->pointer_info.surface_x, - seat->pointer_info.surface_y, + origin_x + seat->pointer_info.surface_x, + origin_y + seat->pointer_info.surface_y, GDK_CURRENT_TIME); }