From 0b2d73d725354def897d883fa164c263001c4693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 6 Mar 2014 15:01:36 +0100 Subject: Use nativeResourceForIntegration "rootWindow" to get the appRootWindow As the native interface can provide the root window it's better to use that instead of going through QDesktopWidget. Change-Id: I0a7b475b5ef2a802f603b29762bf2d9033dfa13d Reviewed-by: David Faure --- src/x11extras/qx11info_x11.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/x11extras/qx11info_x11.cpp') 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(reinterpret_cast(native->nativeResourceForIntegration(QByteArrayLiteral("rootwindow")))); } /*! -- cgit v1.2.1 From 41451c6247d35e90581622b969515378632f3313 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 12 Mar 2014 19:15:22 +0900 Subject: remove QtWidgets dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The module doesn't depend on QtWidgets any more. Change-Id: Ic8036ec1ee53ef8b1a3bb6c827fb815f322865a2 Reviewed-by: Martin Gräßlin Reviewed-by: David Faure Reviewed-by: Oswald Buddenhagen --- src/x11extras/qx11info_x11.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/x11extras/qx11info_x11.cpp') diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index 8295243..9e2cc3b 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -52,9 +52,8 @@ #include #include #include -#include #include -#include +#include #include QT_BEGIN_NAMESPACE -- cgit v1.2.1