aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-01-09 09:52:39 +0100
committerGitHub <noreply@github.com>2019-01-09 09:52:39 +0100
commitff62425480ea35a5b4626ea43dbf064478d4e2fa (patch)
treeea273b5cc651b4977139f901db9cd767f0788ff5
parentda8f24de1d3d5843142be1164919ca6a49155ae9 (diff)
parent1feb2ce064140ccd318f35eec2fa62c89ed4e9d9 (diff)
Merge pull request #3387 from RedSoxFan/keyboard-timer-before-execute
keyboard: update repeat timer before execution
-rw-r--r--sway/input/keyboard.c13
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) {
get_active_binding(&keyboard->state_keysyms_raw,
config->current_mode->keysym_bindings, &binding,
raw_modifiers, false, input_inhibited, device_identifier);
-
- if (binding) {
- seat_execute_command(seat, binding);
- handled = true;
- }
}
- // Set up (or clear) keyboard repeat for a pressed binding
+ // Set up (or clear) keyboard repeat for a pressed binding. Since the
+ // binding may remove the keyboard, the timer needs to be updated first
if (binding && wlr_device->keyboard->repeat_info.delay > 0) {
keyboard->repeat_binding = binding;
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) {
}
}
+ if (binding) {
+ seat_execute_command(seat, binding);
+ handled = true;
+ }
+
// Compositor bindings
if (!handled && event->state == WLR_KEY_PRESSED) {
handled = keyboard_execute_compositor_binding(