Blame SOURCES/0036-Cursor-position-0-should-still-show-the-cursor.patch

f38a11
From d3b794920d643fc5d722f63ad52b91e8143c0de0 Mon Sep 17 00:00:00 2001
b814f0
From: Weng Xuetian <wengxt@gmail.com>
b814f0
Date: Tue, 8 Feb 2022 07:11:25 -0800
f38a11
Subject: [PATCH 36/40] Cursor position == 0 should still show the cursor
b814f0
b814f0
Otherwise the cursor would be hidden even if preedit is empty.
b814f0
Amends 719a55be13bdadfa659a732755f280e276a894bd
b814f0
b814f0
Pick-to: 5.15 6.2 6.3
b814f0
Change-Id: I320733b917779b7b51aa4a28eaea411fdb10a318
b814f0
Reviewed-by: Liang Qi <liang.qi@qt.io>
b814f0
(cherry picked from commit 31ae194e295651d9ece03408630d2358acd4f7b4)
b814f0
---
b814f0
 src/shared/qwaylandinputmethodeventbuilder.cpp | 4 ++--
b814f0
 1 file changed, 2 insertions(+), 2 deletions(-)
b814f0
b814f0
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
b814f0
index 25be2509..458d818e 100644
b814f0
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
b814f0
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
b814f0
@@ -151,9 +151,9 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t
b814f0
 {
b814f0
     QList<QInputMethodEvent::Attribute> attributes;
b814f0
 
b814f0
-    if (m_preeditCursor <= 0) {
b814f0
+    if (m_preeditCursor < 0) {
b814f0
         attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
b814f0
-    } else if (m_preeditCursor > 0) {
b814f0
+    } else {
b814f0
         attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant()));
b814f0
     }
b814f0
 
b814f0
-- 
b814f0
2.35.1
b814f0