From 33710178d4c262d9d2220f0373c4a0c5c62b268c Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 17 Aug 2026 21:22:10 +0900 Subject: [PATCH] wl: no keyboard grab while inactive An activate and a deactivate in one batch left the grab taken with nothing active, which is the one state the grab must never be in: sway hands keys to the grab holder without asking whether the input method is active. sway cannot produce that batch -- relay_send_im_state sends a done after each -- so this is the table being total, not a bug that bit. The deactivate arm was already right; only the activate arm forgot to look at where the batch ended. Co-Authored-By: Claude Opus 5 (1M context) --- wl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wl.c b/wl.c index f3c84df..9f91def 100644 --- a/wl.c +++ b/wl.c @@ -439,7 +439,7 @@ imdone(void*, struct zwp_input_method_v2*) leave(); else if(active && !washidden && hidden()) flushpending(); - if(activated) + if(activated && pendingactive) grabkeyboard(); else if(!pendingactive) releasegrab();