Skip to content

Commit

Permalink
Android: stop composing before pasting new text
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
paulolav committed Aug 21, 2017
1 parent 2282ca4 commit 4700a32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/platforms/android/qandroidinputcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -1138,6 +1138,7 @@ jboolean QAndroidInputContext::copyURL()

jboolean QAndroidInputContext::paste()
{
finishComposingText();
m_cursorHandleShown = CursorHandleNotShown;
sendShortcut(QKeySequence::Paste);
return JNI_TRUE;
Expand Down

0 comments on commit 4700a32

Please sign in to comment.