From ef3de1e58e96bb464f49e7ce6dde64c68bb2c71f Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 7 Aug 2024 13:59:20 +0200 Subject: [PATCH] wayland: Also cancel XDnD drops with no selected target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: --- src/wayland/meta-xwayland-dnd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c index f47ca93d5..38596751a 100644 --- a/src/wayland/meta-xwayland-dnd.c +++ b/src/wayland/meta-xwayland-dnd.c @@ -916,9 +916,10 @@ drag_xgrab_release (MetaWaylandEventHandler *handler, CLUTTER_BUTTON3_MASK | CLUTTER_BUTTON4_MASK | CLUTTER_BUTTON5_MASK)) <= 1 && - (!meta_wayland_drag_grab_get_focus (drag_grab) || - meta_wayland_data_source_get_current_action (data_source) == - WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE)) + ((!meta_wayland_drag_grab_get_focus (drag_grab) || + meta_wayland_data_source_get_current_action (data_source) == + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE) || + !meta_wayland_data_source_has_target (data_source))) meta_xwayland_end_dnd_grab (&seat->data_device, FALSE); return CLUTTER_EVENT_PROPAGATE;