From d0741f4267ccc2bbffd59e535fc4432e2d9d852d Mon Sep 17 00:00:00 2001 From: Vova Mshanetskiy Date: Fri, 26 Apr 2019 21:42:45 +0300 Subject: 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 --- src/plugins/platforms/android/qandroidinputcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) 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); -- cgit v1.2.3