[bumblebee] Make update lock on input non-blocking

for consistent lock behaviour, make the input loop lock non-blocking.

see #702
This commit is contained in:
Tobias Witek 2020-09-13 11:21:39 +02:00
parent aa6238a5c6
commit e42f09b27e

View file

@ -68,10 +68,10 @@ def handle_input(output, update_lock):
modules[event["name"]] = True
except ValueError:
pass
update_lock.acquire()
core.event.trigger("update", modules.keys())
core.event.trigger("draw")
update_lock.release()
if update_lock.acquire(blocking=False) == True:
core.event.trigger("update", modules.keys(), force=True)
core.event.trigger("draw")
update_lock.release()
poll.unregister(sys.stdin.fileno())