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(-) 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 --- qtx11extras.pro | 2 +- src/x11extras/qx11info_x11.cpp | 3 +-- src/x11extras/x11extras.pro | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/qtx11extras.pro b/qtx11extras.pro index 318861f..fe127be 100644 --- a/qtx11extras.pro +++ b/qtx11extras.pro @@ -1,3 +1,3 @@ -requires(qtHaveModule(widgets)) +requires(qtHaveModule(gui)) load(qt_parts) 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 diff --git a/src/x11extras/x11extras.pro b/src/x11extras/x11extras.pro index 80dc421..730a145 100644 --- a/src/x11extras/x11extras.pro +++ b/src/x11extras/x11extras.pro @@ -6,7 +6,7 @@ QMAKE_DOCS = $$PWD/doc/qtx11extras.qdocconf load(qt_module) -QT += widgets gui-private +QT += gui-private HEADERS += qx11info_x11.h SOURCES += qx11info_x11.cpp -- cgit v1.2.1 From 01754de4776905205d38d7bc66fa7b7caa0fe79b Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Sat, 15 Mar 2014 12:21:57 +0100 Subject: Fix hard dep on widgets for autotests Change-Id: I4a847eb9480eb6343fe60c71ec3e37bd6887af9f Reviewed-by: Simon Hausmann --- tests/auto/auto.pro | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 5e02e95..5e3ced2 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,4 +1,6 @@ TEMPLATE=subdirs -SUBDIRS=\ - qx11info \ - cmake +SUBDIRS=cmake + +qtHaveModule(widgets) { + SUBDIRS += qx11info +} \ No newline at end of file -- cgit v1.2.1