summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2014-11-21 16:08:29 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-11-24 08:49:48 +0100
commit0fc578829115d593c9a09bd4b2a5e9fea1a759d1 (patch)
tree329fdab1496898f9076424fa910233242ec3a94d /src
parentd958a16bc15603dc3dfce36d126b4917d4290945 (diff)
Fix for HTC Pinyin input method
HTC does not do beginBatchEdit/endBatchEdit when committing text. We implement the commit in two steps: first set the text, then move the cursor. To avoid sending an updateSelection for the intermediate state, we need to block updates when we set the text in the editor. Task-number: QTBUG-42300 Change-Id: Icd18700ecf1fba5acb9f8a78762555c1309b221b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index a3848c9c2b..7e81735de9 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -611,6 +611,9 @@ jboolean QAndroidInputContext::endBatchEdit()
*/
jboolean QAndroidInputContext::commitText(const QString &text, jint newCursorPosition)
{
+ bool updateSelectionWasBlocked = m_blockUpdateSelection;
+ m_blockUpdateSelection = true;
+
QInputMethodEvent event;
event.setCommitString(text);
sendInputMethodEventThreadSafe(&event);
@@ -630,6 +633,7 @@ jboolean QAndroidInputContext::commitText(const QString &text, jint newCursorPos
newLocalPos, 0, QVariant()));
}
}
+ m_blockUpdateSelection = updateSelectionWasBlocked;
updateCursorPosition();
return JNI_TRUE;