summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 15:09:55 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 15:09:55 (GMT)
commit29e29b42af59c4200051220b21d65a3bc54154a1 (patch)
tree536dfd3753991ac5428c7afb8b8302bbaf3e2430
parentdda7f305c4410f2d4135677fa4ee353c96d3c54a (diff)
parent01754de4776905205d38d7bc66fa7b7caa0fe79b (diff)
downloadqtx11extras-29e29b42af59c4200051220b21d65a3bc54154a1.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I6d27c3ef1242de08a8b9b6ee619c942982d3384c
-rw-r--r--qtx11extras.pro2
-rw-r--r--src/x11extras/qx11info_x11.cpp18
-rw-r--r--src/x11extras/x11extras.pro2
-rw-r--r--tests/auto/auto.pro8
4 files changed, 12 insertions, 18 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 8bea591..9e2cc3b 100644
--- a/src/x11extras/qx11info_x11.cpp
+++ b/src/x11extras/qx11info_x11.cpp
@@ -52,9 +52,8 @@
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformwindow.h>
#include <qscreen.h>
-#include <qdesktopwidget.h>
#include <qwindow.h>
-#include <qapplication.h>
+#include <qguiapplication.h>
#include <xcb/xcb.h>
QT_BEGIN_NAMESPACE
@@ -160,18 +159,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"))));
}
/*!
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
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