Track input-method contexts by identity

- deactivate only drops the context it names; one replaced by an activate
  is kept until KWin deactivates it
- Moving focus straight from one field to another ends a manual hide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 10:13:27 +02:00
co-authored by Claude Opus 5.5
parent d44aab7772
commit 139a845151
6 changed files with 27 additions and 8 deletions
+4 -2
View File
@@ -22,7 +22,7 @@ public:
Q_SIGNALS:
void activated(::zwp_input_method_context_v1 *context);
void deactivated();
void deactivated(::zwp_input_method_context_v1 *context);
protected:
void zwp_input_method_v1_activate(::zwp_input_method_context_v1 *context) override;
@@ -57,9 +57,11 @@ Q_SIGNALS:
private:
void activate(::zwp_input_method_context_v1 *context);
void deactivate();
void deactivate(::zwp_input_method_context_v1 *context);
KWinInputMethodGlobal m_global;
KWinFakeInput m_fakeInput;
std::unique_ptr<KWinInputContext> m_context;
// Replaced by an activate before KWin deactivated it; kept until it does.
std::unique_ptr<KWinInputContext> m_previous;
};