Revert "Merge pull request #21 from chrys87/nocrash"

This reverts commit ddecf331f6, reversing
changes made to 9ff73d67bc.
This commit is contained in:
chrys 2018-04-13 23:42:18 +02:00
parent ddecf331f6
commit b5f7526345
4 changed files with 5 additions and 7 deletions

View File

@ -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()

View File

@ -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',],
}

View File

@ -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']

View File

@ -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):