From a59b76b77beb7f6a86a4ed6070463a567cf4c9f9 Mon Sep 17 00:00:00 2001 From: Qijia Liu Date: Thu, 12 Sep 2024 14:26:24 -0400 Subject: [PATCH] fix rejected key release resets candidate window (#44) --- patches/rime.patch | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/patches/rime.patch b/patches/rime.patch index c0398f2..14b7d7b 100644 --- a/patches/rime.patch +++ b/patches/rime.patch @@ -82,7 +82,7 @@ index 3ecc012..6bec003 100644 this, "UserDataDir", _("User data dir"), stringutils::concat( diff --git a/src/rimestate.cpp b/src/rimestate.cpp -index a8fe4b9..5dbc18f 100644 +index a8fe4b9..e180c48 100644 --- a/src/rimestate.cpp +++ b/src/rimestate.cpp @@ -11,6 +11,7 @@ @@ -107,7 +107,26 @@ index a8fe4b9..5dbc18f 100644 std::string RimeState::subMode() { std::string result; -@@ -440,6 +446,30 @@ void RimeState::updateUI(InputContext *ic, bool keyRelease) { +@@ -226,11 +232,13 @@ void RimeState::keyEvent(KeyEvent &event) { + engine_->instance()->resetCompose(ic); + } + +- updateUI(ic, event.isRelease()); +- if (!event.isRelease() && !lastSchema.empty() && +- lastSchema == currentSchema() && ic->inputPanel().empty() && +- !changedOptions_.empty()) { +- showChangedOptions(); ++ if (event.accepted()) { ++ updateUI(ic, event.isRelease()); ++ if (!event.isRelease() && !lastSchema.empty() && ++ lastSchema == currentSchema() && ic->inputPanel().empty() && ++ !changedOptions_.empty()) { ++ showChangedOptions(); ++ } + } + } + +@@ -440,6 +448,30 @@ void RimeState::updateUI(InputContext *ic, bool keyRelease) { void RimeState::release() { session_.reset(); }