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 <andy.shaw@qt.io>
Vova Mshanetskiy 2019-04-26 21:42:45 +03:00
parent 73ca3dbf49
commit d0741f4267
1 changed files with 2 additions and 0 deletions

View File

@ -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);