diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-10-02 09:50:10 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2014-10-03 14:00:30 +0200 |
commit | 2e365245c185aa1fb5c130024f30c0a35d927239 (patch) | |
tree | a1c6718250dfcf0ba58410b0e3c2c717541956ba /src/plugins/platforms/android/qandroidinputcontext.cpp | |
parent | 27f5efb8952c61afce97eab3e05e20aaf8402c0e (diff) |
Android: Hide vkb when IM disabled for focus object
When the focus object changes to an object that does not have
IM enabled, we should hide the keyboard instead of resetting it.
This happens, for instance, if you change to a different tab in
an application while a text input in the previous tab had focus.
Previously the input panel would stay open and overlap part of the
new tab.
[ChangeLog][Android] Hide input panel when focus changes to an
object that does not accept input.
Change-Id: I4009d203559582fa02c15fdc1a3f009396af2531
Task-number: QTBUG-32399
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/qandroidinputcontext.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidinputcontext.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index abda72e636..a23d05520c 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -441,10 +441,14 @@ void QAndroidInputContext::reset() { clear(); m_batchEditNestingLevel = 0; - if (qGuiApp->focusObject()) - QtAndroidInput::resetSoftwareKeyboard(); - else - QtAndroidInput::hideSoftwareKeyboard(); + if (qGuiApp->focusObject()) { + QSharedPointer<QInputMethodQueryEvent> query = focusObjectInputMethodQueryThreadSafe(Qt::ImEnabled); + if (!query.isNull() && query->value(Qt::ImEnabled).toBool()) { + QtAndroidInput::resetSoftwareKeyboard(); + return; + } + } + QtAndroidInput::hideSoftwareKeyboard(); } void QAndroidInputContext::commit() |