aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-02-04 23:35:44 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-07 11:05:02 +0000
commit9ed259613783f43522b70224bb049d7207814f2a (patch)
tree102fc502f29464684d640c9745309c71a4fe289a
parent43a68974e53dddeeb0c05e584f4e06e2c7319871 (diff)
quicktextinput: Update IM state after clearing selection with IM event
Virtual keyboard uses quick text input as shadow input control attached on top of the keyboard when the actual input control is obscured by the keyboard. The shadow input is synchronized by the IM update events sent by the actual input control. When the user makes selection or moves cursor on the shadow input control, the change is synchronized to actual input control with input method event (QInputMethodEvent::Selection). This all works, except when there is a selection and the cursor is clicked. The expected outcome is that the selection is cleared, and it is, but it was not reported back to input method. Fix the issue by sending the update in case the selection is cleared. Change-Id: Ieabc9ee97ad9fe6154d46f302314e3ebdfd10de2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 6ab7e33b0549c40a33c1d733e4ab516d34a8a887) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quick/items/qquicktextinput.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index f944cfe7d7..61844ca0e1 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -3511,6 +3511,7 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)
}
selectionChange = true;
} else {
+ selectionChange = m_selstart != m_selend;
m_selstart = m_selend = 0;
}
cursorPositionChanged = true;