From e9630832dec6455d93a9f034e7aab501e1b27b5e Mon Sep 17 00:00:00 2001 From: zsien Date: Wed, 13 Mar 2024 13:11:11 +0800 Subject: [PATCH] Fix can't switch input methods through the systray menu Call focusIn only when input method is accepted, so that focusIn will not be called when the systray menu pops up. --- qt5/platforminputcontext/qfcitxplatforminputcontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp b/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp index b59c13a..caf44e7 100644 --- a/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp +++ b/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp @@ -541,7 +541,7 @@ void QFcitxPlatformInputContext::setFocusObject(QObject *object) { return; } - if (proxy) { + if (proxy && !shouldDisableInputMethod()) { proxy->focusIn(); // We need to delegate this otherwise it may cause self-recursion in // certain application like libreoffice. @@ -634,7 +634,7 @@ void QFcitxPlatformInputContext::createInputContextFinished( #else Q_UNUSED(uuid); #endif - if (window && window == w) { + if (window && window == w && !shouldDisableInputMethod()) { cursorRectChanged(); proxy->focusIn(); }