summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/x11extras/qx11info_x11.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp
index 8bea591..8295243 100644
--- a/src/x11extras/qx11info_x11.cpp
+++ b/src/x11extras/qx11info_x11.cpp
@@ -160,18 +160,11 @@ unsigned long QX11Info::appRootWindow(int screen)
{
if (!qApp)
return 0;
-#if 0
- // This looks like it should work, but gives the wrong value.
- QDesktopWidget *desktop = QApplication::desktop();
- QWidget *screenWidget = desktop->screen(screen);
- QWindow *window = screenWidget->windowHandle();
-#else
Q_UNUSED(screen);
-
- QDesktopWidget *desktop = QApplication::desktop();
- QWindow *window = desktop->windowHandle();
-#endif
- return window->winId();
+ QPlatformNativeInterface *native = qApp->platformNativeInterface();
+ if (!native)
+ return 0;
+ return static_cast<xcb_window_t>(reinterpret_cast<quintptr>(native->nativeResourceForIntegration(QByteArrayLiteral("rootwindow"))));
}
/*!