From 1e289e8d81effcf21a5bc18b0678ef6e5bd0f692 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 28 Sep 2022 14:05:05 +0200 Subject: [PATCH] keybindings: Minor refactor Rewrite this codepath so it handles the grab ops that it cares about, and ignores the rest. This way the code works despite possible future modifications to MetaGrabOp (e.g. META_GRAB_OP_WAYLAND_POPUP removal). Part-of: --- src/core/keybindings.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 8f7efac94..ed2b6bbd3 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2297,9 +2297,6 @@ process_key_event (MetaDisplay *display, keep_grab = TRUE; if (all_keys_grabbed) { - if (display->grab_op == META_GRAB_OP_NONE) - return TRUE; - /* If we get here we have a global grab, because * we're in some special keyboard mode such as window move * mode. @@ -2321,7 +2318,7 @@ process_key_event (MetaDisplay *display, keep_grab = process_keyboard_resize_grab (display, window, event); } } - else + else if (display->grab_op & META_GRAB_OP_MOVING) { meta_topic (META_DEBUG_KEYBINDINGS, "Processing event for mouse-only move/resize");