From: John Lindgren Date: Wed, 4 Oct 2023 22:43:11 +0000 (-0400) Subject: keyboard: allow switching VT when locked X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=0acdf041b86f7952e69aa66162a98bd3997b74df;p=proto%2Flabwc.git keyboard: allow switching VT when locked --- diff --git a/src/keyboard.c b/src/keyboard.c index da25b798..43c84755 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -257,20 +257,6 @@ handle_compositor_keybindings(struct keyboard *keyboard, return true; } - /* - * Ignore labwc keybindings if input is inhibited - * It's important to do this after key_state_set_pressed() to ensure - * _all_ key press/releases are registered - */ - if (seat->active_client_while_inhibited) { - return false; - } - if (seat->server->session_lock) { - return false; - } - - uint32_t modifiers = wlr_keyboard_get_modifiers(wlr_keyboard); - /* Catch C-A-F1 to C-A-F12 to change tty */ if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) { for (int i = 0; i < translated.nr_syms; i++) { @@ -287,6 +273,20 @@ handle_compositor_keybindings(struct keyboard *keyboard, } } + /* + * Ignore labwc keybindings if input is inhibited + * It's important to do this after key_state_set_pressed() to ensure + * _all_ key press/releases are registered + */ + if (seat->active_client_while_inhibited) { + return false; + } + if (seat->server->session_lock) { + return false; + } + + uint32_t modifiers = wlr_keyboard_get_modifiers(wlr_keyboard); + if (server->input_mode == LAB_INPUT_STATE_MENU) { /* * Usually, release events are already caught via _press_event_was_bound().