diff --git a/src/rimeengine.cpp b/src/rimeengine.cpp index 2a6b835..e781016 100644 --- a/src/rimeengine.cpp +++ b/src/rimeengine.cpp @@ -568,6 +568,7 @@ void RimeEngine::notify(RimeSessionId session, const std::string &messageType, const char *icon = ""; const char *tipId = ""; int timeout = 3000; + bool blockMessage = false; if (messageType == "deploy") { tipId = "fcitx-rime-deploy"; icon = "fcitx_rime_deploy"; @@ -585,10 +586,12 @@ void RimeEngine::notify(RimeSessionId session, const std::string &messageType, } updateSchemaMenu(); refreshStatusArea(0); + blockMessage = true; } else if (messageValue == "failure") { needRefreshAppOption_ = false; message = _("Rime has encountered an error. " "See log for details."); + blockMessage = true; } } else if (messageType == "option") { updateStatusArea(session); @@ -603,6 +606,10 @@ void RimeEngine::notify(RimeSessionId session, const std::string &messageType, notifications->call( tipId, _("Rime"), icon, _("Rime"), message, timeout); } + // Block message after error / success. + if (blockMessage) { + blockNotificationFor(30000); + } } RimeState *RimeEngine::state(InputContext *ic) { diff --git a/src/rimestate.cpp b/src/rimestate.cpp index 2f0b685..6a51591 100644 --- a/src/rimestate.cpp +++ b/src/rimestate.cpp @@ -148,7 +148,6 @@ void RimeState::selectSchema(const std::string &schema) { if (api->is_maintenance_mode()) { return; } - engine_->blockNotificationFor(30000); api->set_option(session(), RIME_ASCII_MODE, false); api->select_schema(session(), schema.data()); } @@ -460,7 +459,6 @@ void RimeState::updateUI(InputContext *ic, bool keyRelease) { inputPanel.setAuxDown(Text()); } if (newEmptyExceptAux && lastMode_ != subMode()) { - engine_->blockNotificationFor(30000); engine_->instance()->showInputMethodInformation(ic); ic->updateUserInterface(UserInterfaceComponent::StatusArea); }