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

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