1
0
Fork 0

wayland: Redirect the focus explicitly to the Xdnd drag source

We were relying on the drag source surface to keep receiving events
thanks to it being implicitly grabbed by the button press. This
broke at some point, making the Xdnd drag source unable to keep
directing the DnD operation as it is expected by X11 clients.

To fix this, make the Xdnd MetaWaylandEventInterface stick itself
to the drag source surface keeping the focus of the device driving
the DnD operation, so that the X11 client can still handle events
from it.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3511
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3821>
This commit is contained in:
Carlos Garnacho 2024-06-17 20:23:35 +02:00 committed by Marge Bot
parent a4ec154c8b
commit fd1d8c778b

View file

@ -843,16 +843,17 @@ drag_xgrab_get_focus_surface (MetaWaylandEventHandler *handler,
ClutterEventSequence *sequence, ClutterEventSequence *sequence,
gpointer user_data) gpointer user_data)
{ {
ClutterSeat *clutter_seat; MetaWaylandDragGrab *drag_grab = user_data;
ClutterInputDevice *drag_device;
ClutterEventSequence *drag_sequence;
clutter_seat = clutter_input_device_get_seat (device); drag_device = meta_wayland_drag_grab_get_device (drag_grab, &drag_sequence);
if (sequence ||
device != clutter_seat_get_pointer (clutter_seat)) if (drag_sequence != sequence ||
drag_device != device)
return NULL; return NULL;
return meta_wayland_event_handler_chain_up_get_focus_surface (handler, return meta_wayland_drag_grab_get_origin (drag_grab);
device,
sequence);
} }
static void static void