summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2024-04-04 09:42:00 +0200
committerInho Lee <inho.lee@qt.io>2024-04-05 16:12:38 +0200
commit561a2394e1650e274dcaedb1afc09e2ccad1f784 (patch)
tree8c9f21d3957171d51819293d43e27e83c9fe57fc
parentc488a5334aa2975348db532f2cf93c9747f5d7a6 (diff)
Fix xkbcommon dependency for WaylandSeat.sendUnicodeKeyEvent
Amends c0d108b5042752359c279b41cc6f055f4f18ec60. Unicode conversions will be done without using QXkbCommon. Pick-to: 6.7 Change-Id: I9d9f94b799179f82912bd1be54431e460c37b363 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/compositor/compositor_api/qwaylandseat.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp
index 1ea2e7bcf..0e7df0ec0 100644
--- a/src/compositor/compositor_api/qwaylandseat.cpp
+++ b/src/compositor/compositor_api/qwaylandseat.cpp
@@ -598,11 +598,10 @@ void QWaylandSeat::sendUnicodeKeyEvent(uint unicode, QEvent::Type eventType)
qWarning("Can't send a unicode key event, no keyboard focus, fix the compositor");
return;
}
-
#if QT_CONFIG(im)
- // make a keysym value for the UCS4
- const uint keysym = 0x01000000 | unicode;
- auto text = QXkbCommon::lookupStringNoKeysymTransformations(keysym);
+ QString text;
+ text += QChar::fromUcs4(static_cast<char32_t>(unicode));
+
QKeyEvent event(eventType, Qt::Key_unknown, Qt::KeyboardModifiers{}, text);
if (keyboardFocus()->client()->textInputProtocols().testFlag(QWaylandClient::TextInputProtocol::TextInputV2)) {
QWaylandTextInput *textInput = QWaylandTextInput::findIn(this);
@@ -630,7 +629,7 @@ void QWaylandSeat::sendUnicodeKeyEvent(uint unicode, QEvent::Type eventType)
}
}
#else
- Q_UNUSED(keysym);
+ Q_UNUSED(unicode);
Q_UNUSED(eventType);
qWarning() << "Can't send a unicode key event: Unable to find a text-input protocol.";
#endif