From b5147dca11ea67f72c8292d95f7de7f6853b11fc Mon Sep 17 00:00:00 2001 From: Dmitry Kazakov Date: Wed, 28 May 2025 12:59:25 +0200 Subject: Add QWaylandApplication::xkbContext() It is necessary for the apps that want to manually parse the stream of events from wl_keyborad. Change-Id: I8229ae6e43640d0e7b9597f5f7b35cba59db0f64 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandnativeinterface.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/plugins/platforms/wayland/qwaylandnativeinterface.cpp') diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp index e1586d2446f..c7ecd8a2816 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp @@ -64,6 +64,11 @@ void *QWaylandNativeInterface::nativeResourceForIntegration(const QByteArray &re return touch->wl_touch(); return nullptr; } +#if QT_CONFIG(xkbcommon) + if (lowerCaseResource == "xkb_context") { + return m_integration->display()->xkbContext(); + } +#endif if (lowerCaseResource == "serial") return reinterpret_cast(quintptr(m_integration->display()->defaultInputDevice()->serial())); @@ -126,6 +131,13 @@ wl_seat *QtWaylandClient::QWaylandNativeInterface::lastInputSeat() const return nullptr; } +#if QT_CONFIG(xkbcommon) +struct xkb_context *QtWaylandClient::QWaylandNativeInterface::xkbContext() const +{ + return m_integration->display()->xkbContext(); +} +#endif + void *QWaylandNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); -- cgit v1.2.3