Android: stop composing before pasting new text

We have to exit composition mode before inserting text. Otherwise, the
state of the input method will be out of sync with the contents of the
text editor.

Task-number: QTBUG-61717
Change-Id: I58bf3988ae9e0acf3302e810e46bb0ebeda30d17
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Paul Olav Tvete 2017-08-18 14:11:37 +02:00
parent 2282ca44e4
commit 4700a32f21

View File

@ -303,7 +303,7 @@ static jboolean paste(JNIEnv */*env*/, jobject /*thiz*/)
return JNI_FALSE;
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
qDebug("@@@");
qDebug("@@@ PASTE");
#endif
return m_androidInputContext->paste();
}
@ -1138,6 +1138,7 @@ jboolean QAndroidInputContext::copyURL()
jboolean QAndroidInputContext::paste()
{
finishComposingText();
m_cursorHandleShown = CursorHandleNotShown;
sendShortcut(QKeySequence::Paste);
return JNI_TRUE;