From 72485975cbf5dac528934a53d1445b0fbe8e3875 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 12 Aug 2013 18:12:11 +0200 Subject: [PATCH] It is the sole user of isMultiHead so move the code there --- src/shell/scripting/appinterface.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/shell/scripting/appinterface.cpp b/src/shell/scripting/appinterface.cpp index d3117e9eb..77db1f678 100644 --- a/src/shell/scripting/appinterface.cpp +++ b/src/shell/scripting/appinterface.cpp @@ -35,6 +35,10 @@ #include #include +#ifdef Q_OS_WIN +#include +#endif + #ifdef Q_WS_X11 #include #include @@ -120,7 +124,15 @@ void AppInterface::setTheme(const QString &name) bool AppInterface::multihead() const { - return KGlobalSettings::isMultiHead(); +#ifdef Q_OS_WIN + return GetSystemMetrics(SM_CMONITORS) > 1; +#else + QByteArray multiHead = qgetenv("KDE_MULTIHEAD"); + if (!multiHead.isEmpty()) { + return (multiHead.toLower() == "true"); + } + return false; +#endif } int AppInterface::multiheadScreen() const @@ -128,7 +140,7 @@ int AppInterface::multiheadScreen() const int id = -1; #ifdef Q_WS_X11 - if (KGlobalSettings::isMultiHead()) { + if (multihead()) { // with multihead, we "lie" and say that screen 0 is the default screen, in fact, we pretend // we have only one screen at all Display *dpy = XOpenDisplay(NULL);