From bd420570e21a28683403ac32e73c9c9ebb8daddc Mon Sep 17 00:00:00 2001 From: chrys87 Date: Tue, 13 Sep 2016 13:04:55 +0200 Subject: [PATCH] Update screenManager.py --- src/fenrir-package/core/screenManager.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fenrir-package/core/screenManager.py b/src/fenrir-package/core/screenManager.py index bf48868b..91120fae 100644 --- a/src/fenrir-package/core/screenManager.py +++ b/src/fenrir-package/core/screenManager.py @@ -4,9 +4,11 @@ from utils import debug class screenManager(): def __init__(self): - pass + def initialize(self, environment): - return environment + self.autoIgnoreScreens = [] + if environment['runtime']['settingsManager'].getSettingAsBool(environment,'screen', 'autodetectSuspendingScreen'): + self.autoIgnoreScreens = environment['runtime']['screenDriver'].getIgnoreScreens() def shutdown(self, environment): return environment @@ -18,6 +20,8 @@ class screenManager(): return environment def isSuspendingScreen(self, environment): - return environment['runtime']['screenDriver'].getCurrScreen() in \ - environment['runtime']['settingsManager'].getSetting(environment,'screen', 'suspendingScreen').split(',') + currScreen = environment['runtime']['screenDriver'].getCurrScreen() + return (currScreen in \ + environment['runtime']['settingsManager'].getSetting(environment,'screen', 'suspendingScreen').split(',')) or + (currScreen in self.autoIgnoreScreens)