1
0
Fork 0

wayland: Also cancel XDnD drops with no selected target

This is usually an indication of a failed drop operation if the
drop site didn't request any target. Check for this specifically
on XDnD button release, so that we can cancel the DnD operation
right away.

Inspired on a fix from Jonas Ådahl.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3821>
This commit is contained in:
Carlos Garnacho 2024-08-07 13:59:20 +02:00 committed by Marge Bot
parent 6f2f4c5767
commit ef3de1e58e

View file

@ -916,9 +916,10 @@ drag_xgrab_release (MetaWaylandEventHandler *handler,
CLUTTER_BUTTON3_MASK | CLUTTER_BUTTON3_MASK |
CLUTTER_BUTTON4_MASK | CLUTTER_BUTTON4_MASK |
CLUTTER_BUTTON5_MASK)) <= 1 && CLUTTER_BUTTON5_MASK)) <= 1 &&
(!meta_wayland_drag_grab_get_focus (drag_grab) || ((!meta_wayland_drag_grab_get_focus (drag_grab) ||
meta_wayland_data_source_get_current_action (data_source) == meta_wayland_data_source_get_current_action (data_source) ==
WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE)) WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE) ||
!meta_wayland_data_source_has_target (data_source)))
meta_xwayland_end_dnd_grab (&seat->data_device, FALSE); meta_xwayland_end_dnd_grab (&seat->data_device, FALSE);
return CLUTTER_EVENT_PROPAGATE; return CLUTTER_EVENT_PROPAGATE;