diff options
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 15 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.h | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 7d69564c57..b45bd6a82e 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -80,7 +80,8 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"), QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"), QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"), - QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen") + QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"), + QByteArrayLiteral("rootwindow") }; const QByteArray *end = names + sizeof(names) / sizeof(names[0]); const QByteArray *result = std::find(names, end, key); @@ -142,6 +143,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour case X11Screen: result = x11Screen(); break; + case RootWindow: + result = rootWindow(); + break; default: break; } @@ -264,6 +268,15 @@ void *QXcbNativeInterface::x11Screen() return 0; } +void *QXcbNativeInterface::rootWindow() +{ + QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbConnection *defaultConnection = integration->defaultConnection(); + if (defaultConnection) + return reinterpret_cast<void *>(defaultConnection->rootWindow()); + return 0; +} + void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time) { static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time); diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 9c4fa44d3b..fb1a46014c 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -70,7 +70,8 @@ public: StartupId, TrayWindow, GetTimestamp, - X11Screen + X11Screen, + RootWindow }; QXcbNativeInterface(); @@ -94,6 +95,7 @@ public: void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); + void *rootWindow(); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); |