From 4c78ea915aa1fbf807a554c533f97c28cf26d9b8 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Mon, 16 Nov 2026 10:13:41 +0100 Subject: [PATCH] mark keys consumed before running keybinding functions keybinding() and modekeybinding() ran the bound function before keypress() set consumed[], so a binding that changed focus (e.g. focusstack) sent the held key to the newly focused client in the enter event, while its release was later swallowed as consumed. The client then kept repeating the key indefinitely. --- dwl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dwl.c b/dwl.c index d575f3ac2363b43b8319f0eb6415b0eb70d47ee7..b60125b9d5c8db35dcc06b6a08a78bd503b6c7c3 100644 --- a/dwl.c +++ b/dwl.c @@ -2433,6 +2433,7 @@ keybinding(uint32_t mods, xkb_keycode_t keycode) for (k = keys; k < END(keys); k++) { if (CLEANMASK(mods) == CLEANMASK(k->mod) && keycode == k->keycode && k->func) { + consumed[keycode - 8] = 1; k->func(&k->arg); return 1; } @@ -2455,6 +2456,7 @@ modekeybinding(uint32_t mods, xkb_keycode_t keycode) k = &mk->key; if (CLEANMASK(mods) == CLEANMASK(k->mod) && keycode == k->keycode && k->func) { + consumed[keycode - 8] = 1; k->func(&k->arg); handled = 1; }