summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Moskal <bartlomiej.moskal@qt.io>2021-01-11 11:35:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-19 22:20:19 +0000
commitfe32ed66534ba3cca8112442f1fa37bdff73696e (patch)
tree640cd940a1ecba88eed8eafb2af5d39e443e79d8
parentb5eb77a5520b130b172567fd0d96754d11d737ce (diff)
Android: Finish composing text before Key handling
If the sendKeyEvent was invoked, it means that the button not related with composing text was used. In such case composing text (if it exists) should be immediately finished. Fixes: QTBUG-85715 Change-Id: Ifbca067805b8d20f6a90f95b27210595abed964a Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 0d5b43bed4d75ce4d1f1c5a7b953288f5570350d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
index dab8ebf324..e90de9e24d 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
@@ -46,6 +46,7 @@ import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputMethodManager;
+import android.view.KeyEvent;
import android.graphics.Rect;
import android.app.Activity;
import android.util.DisplayMetrics;
@@ -250,6 +251,16 @@ public class QtInputConnection extends BaseInputConnection
}
@Override
+ public boolean sendKeyEvent(KeyEvent event)
+ {
+ // QTBUG-85715
+ // If the sendKeyEvent was invoked, it means that the button not related with composingText was used
+ // In such case composing text (if it exists) should be finished immediately
+ finishComposingText();
+ return super.sendKeyEvent(event);
+ }
+
+ @Override
public boolean setComposingText(CharSequence text, int newCursorPosition)
{
setClosing(false);