path: root/src/plugins/platforminputcontexts/ibus
diff options
authorJarek Kobus <>2018-02-15 15:45:51 +0100
committerJarek Kobus <>2018-04-04 08:53:35 +0000
commitab7d48625aed1c1bb56148f57f958371e810cf4c (patch)
tree1a934dffbffb0dd75d065367296be841527831d3 /src/plugins/platforminputcontexts/ibus
parentc53b86444ff871801e00e09232dde2d7de4a435b (diff)
Fix read-only text browser sometimes jump to the top of the document
Respect the inputMethodAccepted() attribute of QPlatformInputContext in the ibus input context plugin. This is what for example the windows input context plugin does, too. A text browser that is read-only should not receive input method events that include a cursor placement. So when it receives the focus, we must only convey the received-focus information to the input method if the widget is editable (or accepts input method events generally speaking), because as soon as the ibus process learns about it, it will send an input method event that looks like a "let us reset the state a clean start and place the cursor at the beginning" message. We are not interested in reaching that state with the ibus process. Task-number: QTBUG-63066 Change-Id: I1b0e5f8a396bc31169d6081f9325092b447cf60a Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/plugins/platforminputcontexts/ibus')
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 02f92bbb18..f339938f86 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -254,6 +254,12 @@ void QIBusPlatformInputContext::setFocusObject(QObject *object)
if (!d->busConnected)
+ // 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())
+ return;
if (debug)
qDebug() << "setFocusObject" << object;
if (object)