wayland/data-device: Clear data source when cancelling drag with ESC

This ensures a consistent code path with other cases where the drag
operation might be cancelled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2953>
This commit is contained in:
msizanoen1 2023-04-11 12:28:46 +07:00 committed by msizanoen1
parent ce0d9ccb37
commit 1b140e8cb9

View File

@ -522,7 +522,9 @@ keyboard_drag_grab_key (MetaWaylandKeyboardGrab *grab,
MetaWaylandDragGrab *drag_grab; MetaWaylandDragGrab *drag_grab;
drag_grab = wl_container_of (grab, drag_grab, keyboard_grab); drag_grab = wl_container_of (grab, drag_grab, keyboard_grab);
meta_wayland_data_source_cancel (drag_grab->drag_data_source); meta_wayland_data_device_set_dnd_source (&drag_grab->seat->data_device,
NULL);
unset_selection_source (&drag_grab->seat->data_device, META_SELECTION_DND);
meta_wayland_data_source_set_current_offer (drag_grab->drag_data_source, meta_wayland_data_source_set_current_offer (drag_grab->drag_data_source,
NULL); NULL);
meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor), meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor),