From c4a89851ed949e311d8b84eda413c4ba440485c4 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 5 Jun 2023 11:34:18 +0800 Subject: [PATCH] Clear batch edit state once a new input connection is established * src/androidterm.c (android_handle_ime_event): Clear batch edit state, in case the previous input method forgot to do so. --- src/androidterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/androidterm.c b/src/androidterm.c index afa10a1b94b..2a054715d6a 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -725,6 +725,16 @@ android_handle_ime_event (union android_event *event, struct frame *f) finish_composing_text (f, event->ime.counter, event->ime.length == 1); + + if (event->ime.length == 2) + { + /* Now cancel outstanding batch edits if a new input method + has connected. */ + + f->conversion.batch_edit_flags = 0; + f->conversion.batch_edit_count = 0; + } + break; case ANDROID_IME_SET_COMPOSING_TEXT: -- 2.39.2