From aefe9bc618326a288321fc9ae9522a3ab42e25f0 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Fri, 19 Jun 2026 12:50:32 +0900 Subject: [PATCH] fix gtk: commit pending text on passthrough keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GTK IM module only emitted the commit signal when the key was eaten (r != 0). But when a non-matching key is pressed mid-composition the engine commits the pending preedit and returns eaten=0 so the raw key passes through, sending a commit string with eaten=0. GTK dropped it, silently losing the composed text (e.g. Hangul "ㅇ" + "?" yielded only "?"). Commit whenever a commit string is present, matching the wayland, ibus and xim frontends. Co-Authored-By: Claude Opus 4.8 (1M context) --- gtk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/main.c b/gtk/main.c index 11f14da..55c16cf 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -145,7 +145,7 @@ kpress(GtkIMContext *ctx, GdkEventKey *ev) r = readresp(im, resp, sizeof(resp)); if(r < 0) return FALSE; - if(r != 0 && resp[0] != '\0') + if(resp[0] != '\0') g_signal_emit_by_name(ctx, "commit", resp); return r != 0; }