[bumblebee] add small sleep before update

in some situations/modules (spotify, playerctl, etc.), it is possible
that a state change (e.g. play/pause) takes a small time to actually
propagate into the whole system (e.g. until the next "update" retrieves
the correct value).

To alleviate that, add a very small delay to the update.
This commit is contained in:
tobi-wan-kenobi 2020-09-16 09:09:49 +02:00
parent 8a4fc40947
commit 806b97895e

View file

@ -68,6 +68,8 @@ def handle_input(output, update_lock):
modules[event["name"]] = True
except ValueError:
pass
time.sleep(0.2)
if update_lock.acquire(blocking=False) == True:
core.event.trigger("update", modules.keys(), force=True)
core.event.trigger("draw")