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>
(cherry picked from commit fd1d8c778b)
This commit is contained in:
Carlos Garnacho 2024-06-17 20:23:35 +02:00 committed by Jonas Ådahl
parent 2a07a0ce9e
commit 7d0d0edda7

View file

@ -842,16 +842,17 @@ drag_xgrab_get_focus_surface (MetaWaylandEventHandler *handler,
ClutterEventSequence *sequence,
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);
if (sequence ||
device != clutter_seat_get_pointer (clutter_seat))
drag_device = meta_wayland_drag_grab_get_device (drag_grab, &drag_sequence);
if (drag_sequence != sequence ||
drag_device != device)
return NULL;
return meta_wayland_event_handler_chain_up_get_focus_surface (handler,
device,
sequence);
return meta_wayland_drag_grab_get_origin (drag_grab);
}
static void