From 8ecd69c5001414bc914bf89cb290b55150840b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 21 Jun 2019 18:40:53 +0200 Subject: [PATCH] input: stop key repeater when input focus is lost --- input.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index a66e45bd..ed4724d5 100644 --- a/input.c +++ b/input.c @@ -52,10 +52,14 @@ static void keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *surface) { -#if 0 struct terminal *term = data; - term->status = EXIT; -#endif + + mtx_lock(&term->kbd.repeat.mutex); + if (term->kbd.repeat.cmd != REPEAT_EXIT) { + term->kbd.repeat.cmd = REPEAT_STOP; + cnd_signal(&term->kbd.repeat.cond); + } + mtx_unlock(&term->kbd.repeat.mutex); } static void