Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12
-
None
Description
WebEngine performs Input Method Events asynchronously:
- WebEngine accepts the event
- WebEngine converts it for Chromium
- WebEngine sends it to Chromium's renderer process
- WebEngine's event handler returns
- The Chromium's renderer process notifies WebEngine about the input method is performed
- WebEngine calls QInputMethod::update() to notify the embedder application (or virtual keyboard) about the change ( https://codereview.qt-project.org/#/c/246203/ )
Virtual keyboard doesn't seem to be prepared for the asynchronous handling of these events (src/virtualkeyboard/qvirtualkeyboardinputcontext_p.cpp):
void QVirtualKeyboardInputContextPrivate::sendInputMethodEvent(QInputMethodEvent *event)
{
QVirtualKeyboardScopedState inputMethodEventState(this, State::InputMethodEvent);
platformInputContext->sendEvent(event);
}
When PlatformInputContext::sendEvent() returns, WebEngine has not performed the event yet but VirtualKeyboard clears its InputMethodEvent state.
Due to this, VirtualKeyboard will consider the result of its own event as another one and tries to trigger a yet another one by QVirtualKeyboardInputEngine::reselect().
This causes assert like this: https://bugreports.qt.io/browse/QTBUG-70158 or glitches (eg. commit an earlier text prediction) when changing cursor position or switching
input field.
Attachments
Issue Links
- relates to
-
QTBUG-70158 QtVirtualKeyboard asserts with WebEngineView
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-71995 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
294952,2 | Account for when an InputMethodEvent is handled asynchronously | 5.15 | qt/qtvirtualkeyboard | Status: NEW | -1 | 0 |
294953,2 | Renable predictive text as Qt Virtual Keyboard can handle it now | 5.15 | qt/qtwebengine | Status: NEW | -1 | 0 |