3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 20:35:29 +02:00

Merge pull request from gcalero/keyboard_crashing

Possible fix for keyboard crash
This commit is contained in:
Sam Gondelman 2018-03-14 15:53:17 -07:00 committed by GitHub
commit 46bbfc2680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,11 +188,13 @@ bool OffscreenSurface::eventFilter(QObject* originalDestination, QEvent* event)
event->ignore();
if (QCoreApplication::sendEvent(window->activeFocusItem(), event)) {
bool eventAccepted = event->isAccepted();
QInputMethodQueryEvent* imqEvent = static_cast<QInputMethodQueryEvent*>(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<QInputMethodQueryEvent *>(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;
}