Skip to content

Commit

Permalink
Determine whether the obtained IC is the currently active IC, and the…
Browse files Browse the repository at this point in the history
…n determine whether the engine needs to be inactivated

1. In most cases, focus out should be called first, and then focus in.
2. Before the input method engine deactivates, determine whether the obtained IC is the currently activated IC, and then decide whether to inactivate the engine. If it is not the currently activated IC, it does not need to deactivate the engine to avoid the inactivation of the input method engine
  • Loading branch information
hantengc committed Aug 26, 2024
1 parent cd03fee commit b72a863
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/fcitx/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,10 @@ void Instance::deactivateInputMethod(InputContextEvent &event) {
if (!engine || !entry) {
return;
}

if (ic != mostRecentInputContext()) {
return;
}
inputState->overrideDeactivateIM_ = entry->uniqueName();
engine->deactivate(*entry, event);
inputState->overrideDeactivateIM_.clear();
Expand Down

0 comments on commit b72a863

Please sign in to comment.