From 4175e0dc32ec4f6f7bacf3cdec66027b1b3a82ae Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 6 Feb 2025 18:08:46 +0100 Subject: [PATCH] PreeditHandler: update preedit string when it's empty (#1174) See also https://bugreports.qt.io/browse/QTBUG-127995 , Deleted character appears again when switching languages (Mozc / IBus) PiperOrigin-RevId: 723804210 --- src/unix/ibus/preedit_handler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/ibus/preedit_handler.cc b/src/unix/ibus/preedit_handler.cc index 38f22f264..e424ddd6b 100644 --- a/src/unix/ibus/preedit_handler.cc +++ b/src/unix/ibus/preedit_handler.cc @@ -109,6 +109,8 @@ int CursorPos(const commands::Output &output) { bool PreeditHandler::Update(IbusEngineWrapper *engine, const commands::Output &output) { if (!output.has_preedit()) { + IbusTextWrapper empty_text(""); + engine->UpdatePreeditTextWithMode(&empty_text, 0); engine->HidePreeditText(); return true; }