summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorWeng Xuetian <wengxt@gmail.com>2022-02-08 07:11:25 -0800
committerLiang Qi <liang.qi@qt.io>2022-02-12 15:27:24 +0000
commit31ae194e295651d9ece03408630d2358acd4f7b4 (patch)
tree63374620535adf28cffe4a803c9251d6f14aa202 /src/shared
parent8dd71ab5a37b4a65de2316cb935cd2896b0427ea (diff)
Cursor position == 0 should still show the cursor
Otherwise the cursor would be hidden even if preedit is empty. Amends 719a55be13bdadfa659a732755f280e276a894bd Pick-to: 5.15 6.2 6.3 Change-Id: I320733b917779b7b51aa4a28eaea411fdb10a318 Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'src/shared')
-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 b52543fcb..9b2d7a1cc 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -153,9 +153,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()));
}