input/{keyboard,switch}: rename input_inhibited variable to locked

This is more descriptive now.
master
Simon Ser 12 months ago
parent dbd70faf2e
commit 7ad8c80bfe

@ -405,7 +405,7 @@ static void handle_key_event(struct sway_keyboard *keyboard,
char *device_identifier = input_device_get_identifier(wlr_device); char *device_identifier = input_device_get_identifier(wlr_device);
bool exact_identifier = keyboard->wlr->group != NULL; bool exact_identifier = keyboard->wlr->group != NULL;
seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD); seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
bool input_inhibited = server.session_lock.locked; bool locked = server.session_lock.locked;
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor = struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
keyboard_shortcuts_inhibitor_get_for_focused_surface(seat); keyboard_shortcuts_inhibitor_get_for_focused_surface(seat);
bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active; bool shortcuts_inhibited = sway_inhibitor && sway_inhibitor->inhibitor->active;
@ -423,17 +423,17 @@ static void handle_key_event(struct sway_keyboard *keyboard,
struct sway_binding *binding_released = NULL; struct sway_binding *binding_released = NULL;
get_active_binding(&keyboard->state_keycodes, get_active_binding(&keyboard->state_keycodes,
config->current_mode->keycode_bindings, &binding_released, config->current_mode->keycode_bindings, &binding_released,
keyinfo.code_modifiers, true, input_inhibited, keyinfo.code_modifiers, true, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
get_active_binding(&keyboard->state_keysyms_raw, get_active_binding(&keyboard->state_keysyms_raw,
config->current_mode->keysym_bindings, &binding_released, config->current_mode->keysym_bindings, &binding_released,
keyinfo.raw_modifiers, true, input_inhibited, keyinfo.raw_modifiers, true, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
get_active_binding(&keyboard->state_keysyms_translated, get_active_binding(&keyboard->state_keysyms_translated,
config->current_mode->keysym_bindings, &binding_released, config->current_mode->keysym_bindings, &binding_released,
keyinfo.translated_modifiers, true, input_inhibited, keyinfo.translated_modifiers, true, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
@ -455,17 +455,17 @@ static void handle_key_event(struct sway_keyboard *keyboard,
if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED) {
get_active_binding(&keyboard->state_keycodes, get_active_binding(&keyboard->state_keycodes,
config->current_mode->keycode_bindings, &binding, config->current_mode->keycode_bindings, &binding,
keyinfo.code_modifiers, false, input_inhibited, keyinfo.code_modifiers, false, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
get_active_binding(&keyboard->state_keysyms_raw, get_active_binding(&keyboard->state_keysyms_raw,
config->current_mode->keysym_bindings, &binding, config->current_mode->keysym_bindings, &binding,
keyinfo.raw_modifiers, false, input_inhibited, keyinfo.raw_modifiers, false, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
get_active_binding(&keyboard->state_keysyms_translated, get_active_binding(&keyboard->state_keysyms_translated,
config->current_mode->keysym_bindings, &binding, config->current_mode->keysym_bindings, &binding,
keyinfo.translated_modifiers, false, input_inhibited, keyinfo.translated_modifiers, false, locked,
shortcuts_inhibited, device_identifier, shortcuts_inhibited, device_identifier,
exact_identifier, keyboard->effective_layout); exact_identifier, keyboard->effective_layout);
} }

@ -33,8 +33,8 @@ static bool sway_switch_trigger_test(enum sway_switch_trigger trigger,
} }
static void execute_binding(struct sway_switch *sway_switch) { static void execute_binding(struct sway_switch *sway_switch) {
struct sway_seat* seat = sway_switch->seat_device->sway_seat; struct sway_seat *seat = sway_switch->seat_device->sway_seat;
bool input_inhibited = server.session_lock.locked; bool locked = server.session_lock.locked;
list_t *bindings = config->current_mode->switch_bindings; list_t *bindings = config->current_mode->switch_bindings;
struct sway_switch_binding *matched_binding = NULL; struct sway_switch_binding *matched_binding = NULL;
@ -51,13 +51,13 @@ static void execute_binding(struct sway_switch *sway_switch) {
continue; continue;
} }
bool binding_locked = binding->flags & BINDING_LOCKED; bool binding_locked = binding->flags & BINDING_LOCKED;
if (!binding_locked && input_inhibited) { if (!binding_locked && locked) {
continue; continue;
} }
matched_binding = binding; matched_binding = binding;
if (binding_locked == input_inhibited) { if (binding_locked == locked) {
break; break;
} }
} }

Loading…
Cancel
Save