summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhan Quang Minh <phanquangminh217@gmail.com>2022-10-07 13:52:38 +0700
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-12-01 04:11:33 +0000
commitc9837c84aaeebb6ef2420c576969fd7b46822d71 (patch)
tree919cc4e64038a84b8026a8a576f7d2748b262582
parentProper clearing of WinRT factory cache in QWindowsTheme (diff)
downloadqtbase-c9837c84aaeebb6ef2420c576969fd7b46822d71.tar.xz
qtbase-c9837c84aaeebb6ef2420c576969fd7b46822d71.zip
ibus: check object validity before honoring `inputMethodAccepted()`
`inputMethodAccepted()` always return false if there is no current focus object. This means QIBusPlatformInputContext will fail to send the necessary `FocusOut` request to the input context, causing IBus to not send the appropriate content type information to the panel service when the application regains focus and issue a `FocusIn` request. This results in issues like https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5346, which can happen when a Qt application is in foreground as the IBus daemon fails to propagate the content type information to GNOME Shell, which acts as the panel service on GNOME systems. Fix this by checking for the validity of `object` before honoring the result of `inputMethodAccepted()`. Change-Id: I6b79ffc7c5f03ffc05527c29e52a0859f3594bfa Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 95b4cfb1af9aefe3ff3aa151804f464388329c63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 0f65a49070..6fcce59381 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -236,7 +236,7 @@ void QIBusPlatformInputContext::setFocusObject(QObject *object)
// It would seem natural here to call FocusOut() on the input method if we
// transition from an IME accepted focus object to one that does not accept it.
// Mysteriously however that is not sufficient to fix bug QTBUG-63066.
- if (!inputMethodAccepted())
+ if (object && !inputMethodAccepted())
return;
if (debug)