From 88a5e26c6eeb28cf934401d377654236fdf8cdfd Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 8 Oct 2018 20:40:47 +1000 Subject: [PATCH] Remove unneeded variable --- sway/input/keyboard.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 0e14c036..fb1fe7b5 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -264,29 +264,27 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { } // Identify and execute active pressed binding - struct sway_binding *next_repeat_binding = NULL; + struct sway_binding *binding = NULL; if (event->state == WLR_KEY_PRESSED) { - struct sway_binding *binding_pressed = NULL; get_active_binding(&keyboard->state_keycodes, - config->current_mode->keycode_bindings, &binding_pressed, + config->current_mode->keycode_bindings, &binding, code_modifiers, false, input_inhibited); get_active_binding(&keyboard->state_keysyms_translated, - config->current_mode->keysym_bindings, &binding_pressed, + config->current_mode->keysym_bindings, &binding, translated_modifiers, false, input_inhibited); get_active_binding(&keyboard->state_keysyms_raw, - config->current_mode->keysym_bindings, &binding_pressed, + config->current_mode->keysym_bindings, &binding, raw_modifiers, false, input_inhibited); - if (binding_pressed) { - next_repeat_binding = binding_pressed; - seat_execute_command(seat, binding_pressed); + if (binding) { + seat_execute_command(seat, binding); handled = true; } } // Set up (or clear) keyboard repeat for a pressed binding - if (next_repeat_binding && wlr_device->keyboard->repeat_info.delay > 0) { - keyboard->repeat_binding = next_repeat_binding; + if (binding && wlr_device->keyboard->repeat_info.delay > 0) { + keyboard->repeat_binding = binding; if (wl_event_source_timer_update(keyboard->key_repeat_source, wlr_device->keyboard->repeat_info.delay) < 0) { wlr_log(WLR_DEBUG, "failed to set key repeat timer");