compositor/window-drag: Fix keyboard resize

Both GRAB_OP_KEYBOARD_MOVING and GRAB_OP_KEYBOARD_RESIZING_* are
defined as GRAB_OP_WINDOW_BASE with FLAG_KEYBOARD set, but the
latter have additional bits set to indicate the direction.

That is, the GRAB_OP_KEYBOARD_MOVING bitmask cannot be used to
differentiate between move- and resize operations. Instead,
check that no direction bits are set.

https://gitlab.gnome.org/GNOME/mutter/-/issues/2684

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2908>
This commit is contained in:
Florian Müllner 2023-03-10 19:11:33 +01:00 committed by Marge Bot
parent 3988f5a47f
commit f14dcb023d

View File

@ -1097,8 +1097,8 @@ process_key_event (MetaWindowDrag *window_drag,
if (window_drag->grab_op & META_GRAB_OP_WINDOW_FLAG_KEYBOARD) if (window_drag->grab_op & META_GRAB_OP_WINDOW_FLAG_KEYBOARD)
{ {
if ((window_drag->grab_op & META_GRAB_OP_KEYBOARD_MOVING) == if ((window_drag->grab_op & (META_GRAB_OP_WINDOW_DIR_MASK |
META_GRAB_OP_KEYBOARD_MOVING) META_GRAB_OP_WINDOW_FLAG_UNKNOWN)) == 0)
{ {
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard move"); "Processing event for keyboard move");