#include "KisWaylandKeyboardWatcher.h"
#include <kis_debug.h>
#include <QWaylandClientExtension>
#include <qwayland-wayland.h>
#include <config-qt-wayland-patches-present.h>
#include <QtGui/private/qxkbcommon_p.h>
#include <sys/mman.h>
#include <unistd.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtWaylandClient/private/qwaylandintegration_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include "KisWaylandKeyboardWatcher.moc"
Go to the source code of this file.
◆ getGlobalXkbContextFromQt()
| static struct xkb_context * getGlobalXkbContextFromQt |
( |
| ) |
|
|
static |
Linking to QPlatformIntegration has no binary compatibility guarantees, so we should prefer the usage of a direct published interface that is more stable.
Definition at line 34 of file KisWaylandKeyboardWatcher.cpp.
34 {
35#if KRITA_QT_HAS_XKB_CONTEXT_IN_NATIVE_INTERFACE
36 auto waylandApp = qGuiApp->nativeInterface<QNativeInterface::QWaylandApplication>();
37 return waylandApp ? waylandApp->xkbContext() : nullptr;
38#else
43 QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration();
44 auto waylandIntegration = dynamic_cast<QtWaylandClient::QWaylandIntegration *>(platformIntegration);
45 return waylandIntegration ? waylandIntegration->display()->xkbContext() : nullptr;
46#endif
47}