From b5f7526345e0b2e527cc58c421a6614b84ecf426 Mon Sep 17 00:00:00 2001 From: chrys Date: Fri, 13 Apr 2018 23:42:18 +0200 Subject: [PATCH] Revert "Merge pull request #21 from chrys87/nocrash" This reverts commit ddecf331f6de81d06adf629de7c836cf284dd60e, reversing changes made to 9ff73d67bc668873d34d774f8bf51c0cf0dd7899. --- src/fenrirscreenreader/core/fenrirManager.py | 2 +- src/fenrirscreenreader/core/generalData.py | 4 ++-- src/fenrirscreenreader/core/inputManager.py | 1 - src/fenrirscreenreader/inputDriver/evdevDriver.py | 5 ++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/fenrirscreenreader/core/fenrirManager.py b/src/fenrirscreenreader/core/fenrirManager.py index 0c0c8d5d..5254bf9e 100644 --- a/src/fenrirscreenreader/core/fenrirManager.py +++ b/src/fenrirscreenreader/core/fenrirManager.py @@ -225,7 +225,7 @@ class fenrirManager(): self.environment['runtime']['eventManager'].stopMainEventLoop() self.environment['runtime']['outputManager'].presentText(_("Quit Fenrir"), soundIcon='ScreenReaderOff', interrupt=True) self.environment['runtime']['eventManager'].cleanEventQueue() - time.sleep(1) + time.sleep(0.6) for currManager in self.environment['general']['managerList']: if self.environment['runtime'][currManager]: self.environment['runtime'][currManager].shutdown() diff --git a/src/fenrirscreenreader/core/generalData.py b/src/fenrirscreenreader/core/generalData.py index c4b41633..c50fff4b 100644 --- a/src/fenrirscreenreader/core/generalData.py +++ b/src/fenrirscreenreader/core/generalData.py @@ -11,8 +11,8 @@ generalData = { 'tutorialMode': False, 'currUser':'', 'prevUser':'', -'managerList':['processManager', 'punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager' - , 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager', 'debug'], +'managerList':[ 'punctuationManager', 'byteManager', 'cursorManager', 'applicationManager', 'commandManager' + , 'screenManager', 'inputManager','outputManager', 'helpManager', 'memoryManager', 'eventManager','processManager', 'debug'], 'commandFolderList':['commands','onKeyInput', 'onByteInput', 'onCursorChange', 'onScreenUpdate','onScreenChanged','onHeartBeat', 'onPlugInputDevice' ,'onApplicationChange','onSwitchApplicationProfile','help',], } diff --git a/src/fenrirscreenreader/core/inputManager.py b/src/fenrirscreenreader/core/inputManager.py index 30bd072e..b74f4ef9 100644 --- a/src/fenrirscreenreader/core/inputManager.py +++ b/src/fenrirscreenreader/core/inputManager.py @@ -24,7 +24,6 @@ class inputManager(): self.env = environment self.env['runtime']['settingsManager'].loadDriver(\ self.env['runtime']['settingsManager'].getSetting('keyboard', 'driver'), 'inputDriver') - self.updateInputDevices() # init LEDs with current state self.env['input']['newNumLock'] = self.env['runtime']['inputDriver'].getLedState() self.env['input']['oldNumLock'] = self.env['input']['newNumLock'] diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index d3332c9d..7b51a83d 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -52,6 +52,7 @@ class driver(inputDriver): global _evdevAvailableError self.env['runtime']['debug'].writeDebugOut('InputDriver: ' + _evdevAvailableError,debug.debugLevel.ERROR) return + self.updateInputDevices() if _udevAvailable: self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) else: @@ -61,14 +62,12 @@ class driver(inputDriver): context = pyudev.Context() monitor = pyudev.Monitor.from_netlink(context) monitor.filter_by(subsystem='input') - # wait until start process finished - time.sleep(8) monitor.start() while active.value: devices = monitor.poll(2) if devices: while monitor.poll(0.2): - time.sleep(0.1) + time.sleep(0.2) eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) return time.time() def plugInputDeviceWatchdogTimer(self, active):