keyboard: allow switching VT when locked

This commit is contained in:
John Lindgren 2023-10-04 18:43:11 -04:00 committed by Johan Malm
parent 00ce7a2b5e
commit 0acdf041b8

View 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().