From c1c10fca776c65f4e96b69bdb6e13aa76a1c91b1 Mon Sep 17 00:00:00 2001 From: Inho Lee Date: Mon, 9 Dec 2024 12:13:56 +0100 Subject: [PATCH] textinputv3: use the cursorBegin as a cursor position of preedit When using preedit, CJ inputs use the cursor rectangle for showing a candidate list. The cursorBegin of preedit has been used for the position in most compositors and desktop input-methods. Done-by: lilydjwg li Fixes: QTBUG-129331 Pick-to: 6.9 6.8 6.5 Change-Id: Id8a1fa864189ced98672c3b20c169dd6a950d18d Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandtextinputv3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandtextinputv3.cpp b/src/plugins/platforms/wayland/qwaylandtextinputv3.cpp index d98a7a5fca9..75c435a4c5f 100644 --- a/src/plugins/platforms/wayland/qwaylandtextinputv3.cpp +++ b/src/plugins/platforms/wayland/qwaylandtextinputv3.cpp @@ -146,7 +146,7 @@ void QWaylandTextInputv3::zwp_text_input_v3_done(uint32_t serial) // Current supported cursor shape is just line. // It means, cursorEnd and cursorBegin are the same. QInputMethodEvent::Attribute attribute1(QInputMethodEvent::Cursor, - m_pendingPreeditString.text.length(), + m_pendingPreeditString.cursorBegin, 1); attributes.append(attribute1); }