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 18:21:38 +0000
commit8abaee4379c7079e3f19fcc105113e4a0e3d318d (patch)
tree7fbac93f23adbc9387f814016727e4dc9b2ee8f1
parentecedf4e4daea88f707a881f47e0cbe145b499582 (diff)
downloadqtwayland-8abaee4379c7079e3f19fcc105113e4a0e3d318d.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 fcaa0647..e0a3e798 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -162,9 +162,9 @@ QInputMethodEvent *QWaylandInputMethodEventBuilder::buildPreedit(const QString &
{
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()));
}