diff options
authorVova Mshanetskiy <>2019-04-26 21:42:45 +0300
committerVova Mshanetskiy <>2019-05-13 14:52:47 +0300
commitd0741f4267ccc2bbffd59e535fc4432e2d9d852d (patch)
parent73ca3dbf490b33159ba66e936bcb11fbcd03e886 (diff)
QAndroidInputContext: Fix most "Input method out of sync" warnings
According to Android docs start == end in a call to setComposingRegion() means finish composing. But this case was not being handled properly: m_composingText was being assigned an empty string, but m_composingTextStart was being assigned the value of start, which is never -1. There is one other possible cause of "Input method out of sync" warnings, but it is tightly coupled with another bug, so it will be fixed by a separate commit. Change-Id: Ie475df84f330453ce4fc623e8b631b435d7d0042 Reviewed-by: Andy Shaw <>
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 07a6b52dbe..064bfbbce3 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -1231,6 +1231,8 @@ jboolean QAndroidInputContext::setComposingRegion(jint start, jint end)
if (query.isNull())
return JNI_FALSE;
+ if (start == end)
+ return JNI_TRUE;
if (start > end)
qSwap(start, end);