diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/platforms/android/qandroidinputcontext.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/platforms/android/qandroidinputcontext.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index ca9d1e69c9b..e3d488b9583 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -519,6 +519,10 @@ bool QAndroidInputContext::isAnimating() const void QAndroidInputContext::showInputPanel() { + if (QGuiApplication::applicationState() != Qt::ApplicationActive) { + connect(qGuiApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(showInputPanelLater(Qt::ApplicationState))); + return; + } QSharedPointer<QInputMethodQueryEvent> query = focusObjectInputMethodQueryThreadSafe(); if (query.isNull()) return; @@ -541,6 +545,14 @@ void QAndroidInputContext::showInputPanel() query->value(Qt::ImHints).toUInt()); } +void QAndroidInputContext::showInputPanelLater(Qt::ApplicationState state) +{ + if (state != Qt::ApplicationActive) + return; + disconnect(qGuiApp, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(showInputPanelLater(Qt::ApplicationState))); + showInputPanel(); +} + void QAndroidInputContext::hideInputPanel() { QtAndroidInput::hideSoftwareKeyboard(); diff --git a/src/plugins/platforms/android/qandroidinputcontext.h b/src/plugins/platforms/android/qandroidinputcontext.h index 670a0511397..2ebb155d2ac 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.h +++ b/src/plugins/platforms/android/qandroidinputcontext.h @@ -112,6 +112,9 @@ public: public slots: void updateCursorPosition(); +private slots: + void showInputPanelLater(Qt::ApplicationState); + private: void sendInputMethodEventThreadSafe(QInputMethodEvent *event); Q_INVOKABLE void sendInputMethodEventUnsafe(QInputMethodEvent *event); |
