From c5e50b086bc4580684c04f54838b3b8b77d3797d Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 13 May 2018 21:46:51 +0200 Subject: [PATCH] disable device hotplug --- src/fenrirscreenreader/inputDriver/evdevDriver.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 5beecba8..544be9f6 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -54,10 +54,10 @@ class driver(inputDriver): self.env['runtime']['debug'].writeDebugOut('InputDriver: ' + _evdevAvailableError,debug.debugLevel.ERROR) return self.updateInputDevices() - if _udevAvailable: - self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) - else: - self.env['runtime']['processManager'].addSimpleEventThread(fenrirEventType.PlugInputDevice, self.plugInputDeviceWatchdogTimer) + #if _udevAvailable: + # self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) + #else: + # self.env['runtime']['processManager'].addSimpleEventThread(fenrirEventType.PlugInputDevice, self.plugInputDeviceWatchdogTimer) self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog) def plugInputDeviceWatchdogUdev(self,active , eventQueue): context = pyudev.Context() @@ -67,8 +67,8 @@ class driver(inputDriver): while active.value: devices = monitor.poll(2) if devices: - while monitor.poll(0.2): - time.sleep(0.1) + while monitor.poll(0.1): + pass eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) return time.time() def plugInputDeviceWatchdogTimer(self, active):