From 61f1bcc99181bfe99df20dc885d9f7d3cd385685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 7 Sep 2013 17:38:02 +0200 Subject: [PATCH] Revert "Add ability to disable multihead support" The variable is set not from config nor anywhere else when kwin is started through ksmserver by startkde. In addition the KGlobal implementation is twisted compared to the kcminit config behavior (the config value defaults to true, not false - ie. if the variable isn't set (by kcm init) it's reasonable to assume true either. Therefore and in alignment with PW/2, the environment is read directly and on absence resolved to "true". To control the behavior, please export KDE_MULTIHEAD=true/false before starting KWin (eg. in /usr/bin/startkde) This reverts commit ab6d5c048a25bcb2f5bdb822ba3eda64019c61bc. REVIEW: 112579 CCBUG: 256242 --- main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index f951191545..10522950bb 100644 --- a/main.cpp +++ b/main.cpp @@ -48,7 +48,6 @@ along with this program. If not, see . #include #include #include -#include #include "config-workspace.h" @@ -76,6 +75,15 @@ along with this program. If not, see . #undef INT8 #undef INT32 +static bool isMultiHead() +{ + QByteArray multiHead = qgetenv("KDE_MULTIHEAD"); + if (!multiHead.isEmpty()) { + return (multiHead.toLower() == "true"); + } + return true; +} + namespace KWin { @@ -495,7 +503,7 @@ KDE_EXPORT int kdemain(int argc, char * argv[]) int number_of_screens = ScreenCount(dpy); // multi head - if (number_of_screens != 1 && KGlobalSettings::isMultiHead()) { + if (number_of_screens != 1 && isMultiHead()) { KWin::is_multihead = true; KWin::screen_number = DefaultScreen(dpy); int pos; // Temporarily needed to reconstruct DISPLAY var if multi-head