summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/androidjniinput.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2014-02-21 09:58:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 09:59:20 +0100
commit68a9229a97d358639357f76cfb186bb61aa6ce92 (patch)
tree62e72015ffed78821d7f1a8b6d7124594867dbff /src/plugins/platforms/android/androidjniinput.cpp
parentb55e0ac57f95b79879bcd301ff3b7365d957acc2 (diff)
Android input method improvements
Use the new inputmethod query API. and get rid of the hack where we would move the cursor back and forwards to make sure that the Android software keyboard noticed that the cursor had moved. The android plugin now uses absolute positions instead of position within the paragraph for all cursor handling (provided that the control supports the new API). Task-number: QTBUG-37511 Change-Id: I03463dbbcb4acbfa41e2eab06889d021d50da01f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/androidjniinput.cpp')
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index 9d605c7a17..9efdcad158 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -67,8 +67,6 @@ namespace QtAndroidInput
static QPointer<QWindow> m_mouseGrabber;
- static int m_lastCursorPos = -1;
-
void updateSelection(int selStart, int selEnd, int candidatesStart, int candidatesEnd)
{
AttachedJNIEnv env;
@@ -78,21 +76,6 @@ namespace QtAndroidInput
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
qDebug() << ">>> UPDATESELECTION" << selStart << selEnd << candidatesStart << candidatesEnd;
#endif
- if (candidatesStart == -1 && candidatesEnd == -1 && selStart == selEnd) {
- // Qt only gives us position inside the block, so if we move to the
- // same position in another block, the Android keyboard will believe
- // we have not changed position, and be terribly confused.
- if (selStart == m_lastCursorPos) {
-#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
- qDebug() << ">>> FAKEUPDATESELECTION" << selStart+1;
-#endif
- env.jniEnv->CallStaticVoidMethod(applicationClass(), m_updateSelectionMethodID,
- selStart+1, selEnd+1, candidatesStart, candidatesEnd);
- }
- m_lastCursorPos = selStart;
- } else {
- m_lastCursorPos = -1;
- }
env.jniEnv->CallStaticVoidMethod(applicationClass(), m_updateSelectionMethodID,
selStart, selEnd, candidatesStart, candidatesEnd);
}