diff options
author | emersion <contact@emersion.fr> | 2019-01-09 09:52:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 09:52:39 +0100 |
commit | ff62425480ea35a5b4626ea43dbf064478d4e2fa (patch) | |
tree | ea273b5cc651b4977139f901db9cd767f0788ff5 | |
parent | Merge pull request #3385 from robertgzr/reset_output_mapping (diff) | |
parent | keyboard: update repeat timer before execution (diff) | |
download | sway-ff62425480ea35a5b4626ea43dbf064478d4e2fa.tar.gz sway-ff62425480ea35a5b4626ea43dbf064478d4e2fa.tar.zst sway-ff62425480ea35a5b4626ea43dbf064478d4e2fa.zip |
Merge pull request #3387 from RedSoxFan/keyboard-timer-before-execute
keyboard: update repeat timer before execution
-rw-r--r-- | sway/input/keyboard.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index c1b53237..46286410 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -295,14 +295,10 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { | |||
295 | get_active_binding(&keyboard->state_keysyms_raw, | 295 | get_active_binding(&keyboard->state_keysyms_raw, |
296 | config->current_mode->keysym_bindings, &binding, | 296 | config->current_mode->keysym_bindings, &binding, |
297 | raw_modifiers, false, input_inhibited, device_identifier); | 297 | raw_modifiers, false, input_inhibited, device_identifier); |
298 | |||
299 | if (binding) { | ||
300 | seat_execute_command(seat, binding); | ||
301 | handled = true; | ||
302 | } | ||
303 | } | 298 | } |
304 | 299 | ||
305 | // Set up (or clear) keyboard repeat for a pressed binding | 300 | // Set up (or clear) keyboard repeat for a pressed binding. Since the |
301 | // binding may remove the keyboard, the timer needs to be updated first | ||
306 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { | 302 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { |
307 | keyboard->repeat_binding = binding; | 303 | keyboard->repeat_binding = binding; |
308 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 304 | if (wl_event_source_timer_update(keyboard->key_repeat_source, |
@@ -316,6 +312,11 @@ static void handle_keyboard_key(struct wl_listener *listener, void *data) { | |||
316 | } | 312 | } |
317 | } | 313 | } |
318 | 314 | ||
315 | if (binding) { | ||
316 | seat_execute_command(seat, binding); | ||
317 | handled = true; | ||
318 | } | ||
319 | |||
319 | // Compositor bindings | 320 | // Compositor bindings |
320 | if (!handled && event->state == WLR_KEY_PRESSED) { | 321 | if (!handled && event->state == WLR_KEY_PRESSED) { |
321 | handled = keyboard_execute_compositor_binding( | 322 | handled = keyboard_execute_compositor_binding( |