aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-21 16:40:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-21 16:40:53 +0000
commit8ecd69c5001414bc914bf89cb290b55150840b56 (patch)
treef5b5661620b41c232dda9da3330d57ae90021382
parentcsi: fix \e[B - it should move the cursor *down*, not up. (diff)
input: stop key repeater when input focus is lost
-rw-r--r--input.c10
1 files 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