mirror of
https://github.com/brl/mutter.git
synced 2024-12-22 19:12:04 +00:00
wayland/data-offer: Accept final preferrence of drop destination
Quoting the spec for `wl_data_device::drop`:
> If the resulting action is "ask", the action will not be considered
> final. The drag-and-drop destination is expected to perform one last
> wl_data_offer.set_actions request, or wl_data_offer.destroy in order
> to cancel the operation.
We did not respect the action choosen by the drop destination when
it called `wl_data_offer::set_actions` after `wl_data_device::drop`
if a user override was still active. This eventually resulted in
a protocol error in `wl_data_offer::finish`, as the current action
could still be `ask`.
Fix this by only allowing a user override to `ask` before `drop` is
called, thus making sure the final `set_actions` preference is
honored.
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1952
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2043>
(cherry picked from commit 33b834c433
)
This commit is contained in:
parent
cea39b7f0c
commit
3fb3764d27
@ -276,7 +276,9 @@ data_offer_choose_action (MetaWaylandDataOffer *offer)
|
||||
return WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE;
|
||||
|
||||
/* If the user is forcing an action, go for it */
|
||||
if ((user_action & available_actions) != 0)
|
||||
if ((user_action & available_actions) != 0 &&
|
||||
!(user_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK &&
|
||||
meta_wayland_data_source_get_drop_performed (source)))
|
||||
return user_action;
|
||||
|
||||
/* If the dest side has a preferred DnD action, use it */
|
||||
|
Loading…
Reference in New Issue
Block a user