summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-11 16:17:02 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-10-11 16:17:02 +0200
commit75f4661c557882cfc344592f93703d53a64bd8a8 (patch)
treef4e73582f16986cd99eeca07ab3441632c7b00bf
parent2699705aa9c07105bc24c722845acbbd5a02c3e4 (diff)
parentf0e400e1bca13176e56cf7bb323cd0a6393a85ea (diff)
downloadqtx11extras-75f4661c557882cfc344592f93703d53a64bd8a8.tar.gz
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I39296b426d6e7555db5087e720066fad02ffc5d3
-rw-r--r--src/x11extras/qx11info_x11.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp
index 85aa9e1..8bea591 100644
--- a/src/x11extras/qx11info_x11.cpp
+++ b/src/x11extras/qx11info_x11.cpp
@@ -178,14 +178,27 @@ unsigned long QX11Info::appRootWindow(int screen)
Returns the number of the screen where the application is being
displayed.
+ This method refers to screens in the original X11 meaning with a
+ different DISPLAY environment variable per screen.
+ This information is only useful if your application needs to know
+ on which X screen it is running.
+
+ In a typical multi-head configuration, multiple physical monitors
+ are combined in one X11 screen. This means this method returns the
+ same number for each of the physical monitors. In such a setup you
+ are interested in the monitor information as provided by the X11
+ RandR extension. This is available through QDesktopWidget and QScreen.
+
\sa display(), screen()
*/
int QX11Info::appScreen()
{
if (!qApp)
return 0;
- QDesktopWidget *desktop = QApplication::desktop();
- return desktop->primaryScreen();
+ QPlatformNativeInterface *native = qApp->platformNativeInterface();
+ if (!native)
+ return 0;
+ return reinterpret_cast<qintptr>(native->nativeResourceForIntegration(QByteArrayLiteral("x11screen")));
}
/*!