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 <davidedmundson@kde.org>
This commit is contained in:
Inho Lee 2024-12-09 12:13:56 +01:00
parent 446c613fa7
commit c1c10fca77

View File

@ -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);
}