From b02b5ee30de78a8d94998c67a385f4baa9fda5d3 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 4 Jun 2018 08:06:39 +0200 Subject: [PATCH] go silent when enter an ignore screen --- src/fenrirscreenreader/core/inputManager.py | 1 - src/fenrirscreenreader/core/screenManager.py | 4 ++++ tools/fenrir-ignore-screen | 1 - tools/fenrir-unignore-screen | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index 0c212272..2bfb1f13 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -59,7 +59,6 @@ class inputManager(): return if self.env['runtime']['screenManager'].getCurrScreenIgnored(): self.ungrabAllDevices() - self.env['runtime']['outputManager'].interruptOutput() else: self.grabAllDevices() self.executeDeviceGrab = False diff --git a/src/fenrirscreenreader/core/screenManager.py b/src/fenrirscreenreader/core/screenManager.py index 0ad91530..6c5d6aa9 100644 --- a/src/fenrirscreenreader/core/screenManager.py +++ b/src/fenrirscreenreader/core/screenManager.py @@ -61,6 +61,8 @@ class screenManager(): if not self.isSuspendingScreen(self.env['screen']['newTTY']): self.update(eventData, 'onScreenChange') self.env['screen']['lastScreenUpdate'] = time.time() + else: + self.env['runtime']['outputManager'].interruptOutput() def handleScreenUpdate(self, eventData): self.env['screen']['oldApplication'] = self.env['screen']['newApplication'] @@ -74,6 +76,8 @@ class screenManager(): # or len(self.env['screen']['newDelta']) > 6: # self.env['runtime']['screenDriver'].getCurrApplication() self.env['screen']['lastScreenUpdate'] = time.time() + elif self.isCurrScreenIgnoredChanged(): + self.env['runtime']['outputManager'].interruptOutput() def getCurrScreenIgnored(self): return self.currScreenIgnored def getPrevScreenIgnored(self): diff --git a/tools/fenrir-ignore-screen b/tools/fenrir-ignore-screen index c70a4e36..7ded2594 100755 --- a/tools/fenrir-ignore-screen +++ b/tools/fenrir-ignore-screen @@ -33,7 +33,6 @@ if __name__ == "__main__": ignoreFileName = args.file useCurrentScreen = False screen = None - print(args.file) if args.screen: screen = args.screen else: diff --git a/tools/fenrir-unignore-screen b/tools/fenrir-unignore-screen index be3faee2..749859e6 100755 --- a/tools/fenrir-unignore-screen +++ b/tools/fenrir-unignore-screen @@ -33,7 +33,6 @@ if __name__ == "__main__": ignoreFileName = args.file useCurrentScreen = False screen = None - print(args.file) if args.screen: screen = args.screen else: