From 44d9434c1ebaed00834dcb9ba0aeb8f5af2c41cb Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 21 Sep 2017 13:13:27 -0400 Subject: Add a few quick safety checks to ensure that lumina-xconfig never disables the last active screen. --- src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src-qt5/core-utils/lumina-xconfig') diff --git a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp index 3c0edc76..a9d40554 100644 --- a/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp +++ b/src-qt5/core-utils/lumina-xconfig/ScreenSettings.cpp @@ -13,6 +13,7 @@ void RRSettings::ApplyPrevious(){ QList screens; QSettings set("lumina-desktop","lumina-xconfig"); + if(set.allKeys().isEmpty()){ return; } QString profile = set.value("default_profile","").toString(); if(profile.isEmpty() || !savedProfiles().contains(profile) ){ screens = PreviousSettings(); } else{ screens = PreviousSettings(profile); } @@ -167,6 +168,13 @@ bool RRSettings::SaveScreens(QList screens, QString profile){ //Apply screen configuration void RRSettings::Apply(QList screens){ + //Verify that there is at least 1 active/enabled monitor first + bool foundactive = false; + for(int i=0; i