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()`. Pick-to: 5.15 6.2 6.4 Change-Id: I6b79ffc7c5f03ffc05527c29e52a0859f3594bfa Reviewed-by: Liang Qi <liang.qi@qt.io>bb10
parent
5cf72ee6ab
commit
95b4cfb1af
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue