From 34eac2dbe3d3e4332ebd5ea5ff4307f773b1b6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 22 Nov 2019 21:49:50 +0100 Subject: [PATCH] keyboard repeat: pass current input serial to keyboard_key() This fixes an assertion when holding in ctrl+shift+c (copy to clipboard); subsequent "presses" would set the clipboard serial to 0, which we would then assert on in the next iteration when we tried to cancel the previous copy. --- input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input.c b/input.c index d47cf889..60262b14 100644 --- a/input.c +++ b/input.c @@ -153,6 +153,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, { struct wayland *wayl = data; struct terminal *term = wayl->focused; + assert(term != NULL); const xkb_mod_mask_t ctrl = 1 << wayl->kbd.mod_ctrl; @@ -382,7 +383,7 @@ const struct wl_keyboard_listener keyboard_listener = { void input_repeat(struct wayland *wayl, uint32_t key) { - keyboard_key(wayl, NULL, 0, 0, key, XKB_KEY_DOWN); + keyboard_key(wayl, NULL, wayl->input_serial, 0, key, XKB_KEY_DOWN); } static void @@ -418,6 +419,7 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, { struct wayland *wayl = data; struct terminal *term = wayl->moused; + assert(term != NULL); int x = wl_fixed_to_int(surface_x) * term->scale;