qt5-qtwayland/0023-Cursor-position-0-should-still-show-the-cursor.patch

36 lines
1.4 KiB
Diff
Raw Normal View History

2023-01-05 16:03:30 +00:00
From b5ee817f9d1597d6cffb82ec2638d2259e6b1a5a Mon Sep 17 00:00:00 2001
2022-03-08 11:00:00 +00:00
From: Weng Xuetian <wengxt@gmail.com>
Date: Tue, 8 Feb 2022 07:11:25 -0800
2023-01-05 16:03:30 +00:00
Subject: [PATCH 23/57] Cursor position == 0 should still show the cursor
2022-03-08 11:00:00 +00:00
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>
(cherry picked from commit 31ae194e295651d9ece03408630d2358acd4f7b4)
---
src/shared/qwaylandinputmethodeventbuilder.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
index 25be2509..458d818e 100644
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
@@ -151,9 +151,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()));
}
--
2023-01-05 16:03:30 +00:00
2.39.0
2022-03-08 11:00:00 +00:00