mirror of
https://github.com/brl/mutter.git
synced 2025-03-23 19:53:52 +00:00
wayland: Implement dnd cancel on pressing Esc key
When this key is pressed the DnD operation should be cancelled, and the "pop DnD icon back" animation to happen. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/1020
This commit is contained in:
parent
f2f89d9b46
commit
403466c0db
@ -1094,6 +1094,19 @@ static gboolean
|
||||
keyboard_drag_grab_key (MetaWaylandKeyboardGrab *grab,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (event->key.keyval == CLUTTER_KEY_Escape)
|
||||
{
|
||||
MetaWaylandDragGrab *drag_grab;
|
||||
|
||||
drag_grab = wl_container_of (grab, drag_grab, keyboard_grab);
|
||||
meta_wayland_data_source_cancel (drag_grab->drag_data_source);
|
||||
meta_dnd_actor_drag_finish (META_DND_ACTOR (drag_grab->feedback_actor), FALSE);
|
||||
drag_grab->feedback_actor = NULL;
|
||||
data_device_end_drag_grab (drag_grab);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user