From 8a08efe2bb5a6ef9585fb8652fdf7ff502b72132 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 17 Aug 2026 22:10:31 +0900 Subject: [PATCH] wl: a deactivate cannot hand the pending text back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 40fd4ab was half right and the sway run said which half. The compositor does relay the commit when a client merely disabled its text input while holding the focus -- that much was read correctly out of sway -- but the client has stopped listening by then. On the wire, in that order: -> zwp_text_input_v3.disable() -> zwp_text_input_v3.commit() <- zwp_text_input_v3.preedit_string("") <- zwp_text_input_v3.commit_string("가") <- zwp_text_input_v3.done() and the entry unchanged. GTK3 drops global->current at its own focus-out, and any client that follows text-input-v3 does the same, since events between disable and the next enable are to be ignored. So the composition is unrecoverable there, by no fault of ours, and the commit was a request nobody could take. The code goes back to what it was; the comment does not. The old one said the compositor drops the commit, which is true only when the focus moved, and that half-truth is what invited the change. Co-Authored-By: Claude Opus 5 (1M context) --- wl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wl.c b/wl.c index 569c8da..2107be7 100644 --- a/wl.c +++ b/wl.c @@ -343,11 +343,12 @@ releasegrab(void) } /* - * The context is going: give the client its keys back and the pending - * text, as a lost focus does everywhere else. A client that only - * disabled its text input still holds the focus and takes the commit; - * when the focus itself moved, the compositor sent the text input its - * leave first and drops the commit whatever serial it carries. + * The context is going: give the client its keys back. The pending text + * goes nowhere either way -- the compositor drops a commit once the text + * input has its leave, and a client that disabled its own text input has + * stopped listening, so it throws a relayed commit away. XIM and IBus + * hand the text back here because their focus-out is a round trip the + * client still waits on; a deactivate is not. */ static void leave(void) @@ -357,7 +358,6 @@ leave(void) releasekeys(); if(engaged){ sendrequest(Keyrelease, 0, 0, &res); - answer(&res, ""); engaged = 0; takedraw(); }