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ø <tor.arne.vestbo@qt.io>bb10
parent
c53b86444f
commit
ab7d48625a
|
|
@ -254,6 +254,12 @@ void QIBusPlatformInputContext::setFocusObject(QObject *object)
|
|||
if (!d->busConnected)
|
||||
return;
|
||||
|
||||
// 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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue