summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeng Xuetian <wengxt@gmail.com>2022-02-08 07:11:25 -0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-12 19:21:38 +0000
commit9e972ccac4b0c27c54c154117e72d3a7c74fc7db (patch)
tree724042c519d01f921296dfc9a2390541f73df3d7
parent9e39ccd5772e5a386b60be90094acb1a7640ef24 (diff)
downloadqtwayland-9e972ccac4b0c27c54c154117e72d3a7c74fc7db.tar.gz
Cursor position == 0 should still show the cursor
Otherwise the cursor would be hidden even if preedit is empty. Amends 719a55be13bdadfa659a732755f280e276a894bd Change-Id: I320733b917779b7b51aa4a28eaea411fdb10a318 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 31ae194e295651d9ece03408630d2358acd4f7b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/shared/qwaylandinputmethodeventbuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
index 54e5c8a1..2bf276e4 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -160,9 +160,9 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t
{
QList<QInputMethodEvent::Attribute> attributes;
- if (m_preeditCursor <= 0) {
+ if (m_preeditCursor < 0) {
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
- } else if (m_preeditCursor > 0) {
+ } else {
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant()));
}