Merge pull request #3387 from RedSoxFan/keyboard-timer-before-execute

keyboard: update repeat timer before execution
This commit is contained in:
emersion 2019-01-09 09:52:39 +01:00 committed by GitHub
commit ff62425480
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(