diff --git a/libraries/qml/src/qml/OffscreenSurface.cpp b/libraries/qml/src/qml/OffscreenSurface.cpp index d6c11537e6..6580c5b1e8 100644 --- a/libraries/qml/src/qml/OffscreenSurface.cpp +++ b/libraries/qml/src/qml/OffscreenSurface.cpp @@ -181,28 +181,20 @@ bool OffscreenSurface::eventFilter(QObject* originalDestination, QEvent* event) } break; } - case QEvent::InputMethod: { - auto window = getWindow(); - if (window && window->activeFocusItem()) { - event->ignore(); - if (QCoreApplication::sendEvent(window->activeFocusItem(), event)) { - return event->isAccepted(); - } - return false; - } - break; - } + case QEvent::InputMethod: case QEvent::InputMethodQuery: { auto window = getWindow(); if (window && window->activeFocusItem()) { event->ignore(); if (QCoreApplication::sendEvent(window->activeFocusItem(), event)) { bool eventAccepted = event->isAccepted(); - QInputMethodQueryEvent* imqEvent = static_cast(event); - // this block disables the selection cursor in android which appears in - // the top-left corner of the screen - if (imqEvent->queries() & Qt::ImEnabled) { - imqEvent->setValue(Qt::ImEnabled, QVariant(false)); + if (event->type() == QEvent::InputMethodQuery) { + QInputMethodQueryEvent *imqEvent = static_cast(event); + // this block disables the selection cursor in android which appears in + // the top-left corner of the screen + if (imqEvent->queries() & Qt::ImEnabled) { + imqEvent->setValue(Qt::ImEnabled, QVariant(false)); + } } return eventAccepted; }