From b99cbb7be669afaa4ffd4873dded07299600b732 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 14 Dec 2017 08:01:10 +0000 Subject: [PATCH] Remove multihead from Plasmashell scripting Summary: Plasmashell literally never checks the X screen, but we expose it in this scripting system. This patch Hardcodes it to the values you'd have on a normal system. The existing screenCount is unchanged and will still work. Test Plan: compiles Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: apol, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D9174 --- shell/scripting/appinterface.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/shell/scripting/appinterface.cpp b/shell/scripting/appinterface.cpp index 04ca07185..d9d26ca37 100644 --- a/shell/scripting/appinterface.cpp +++ b/shell/scripting/appinterface.cpp @@ -137,34 +137,12 @@ QString AppInterface::languageId() const bool AppInterface::multihead() const { -#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 { - int id = -1; - -#ifdef HAVE_X11 - 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); - if (dpy) { - id = DefaultScreen(dpy); - XCloseDisplay(dpy); - } - } -#endif - - return id; + return 0; } void AppInterface::lockCorona(bool locked)