]> git.mdlowis.com Git - proto/labwc.git/commitdiff
keyboard: allow switching VT when locked
authorJohn Lindgren <john@jlindgren.net>
Wed, 4 Oct 2023 22:43:11 +0000 (18:43 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Thu, 5 Oct 2023 19:14:19 +0000 (20:14 +0100)
src/keyboard.c

index da25b79809bbdf990ff406eb279f805c46696033..43c84755fd21715225b527f23a27e8c652e55a34 100644 (file)
@@ -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().