From 905f71fa525c3e80b443c95f416adb874b95624c Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Fri, 28 Aug 2020 17:14:05 +0200 Subject: [PATCH] [core] fix broken "sparse" updates c77f3aa accidentially broke "sparse" updates (i.e. updates that do not trigger during each update interval). Introduce a new update parameter, "force", to model the use case "update everything on SIGUSR1". fixes #692 --- bumblebee-status | 2 +- bumblebee_status/core/output.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bumblebee-status b/bumblebee-status index e02dfee..dda14e4 100755 --- a/bumblebee-status +++ b/bumblebee-status @@ -106,7 +106,7 @@ def main(): def sig_USR1_handler(signum,stack): if update_lock.acquire(blocking=False) == True: - core.event.trigger("update", redraw_only=False) + core.event.trigger("update", force=True) core.event.trigger("draw") update_lock.release() diff --git a/bumblebee_status/core/output.py b/bumblebee_status/core/output.py index ed36fcd..687cafd 100644 --- a/bumblebee_status/core/output.py +++ b/bumblebee_status/core/output.py @@ -221,15 +221,13 @@ class i3(object): core.event.trigger("next-widget") return blocks - # TODO: only updates full text, not the state!? - # can this TODO be removed now? Will update the state if not redraw_only - def update(self, affected_modules=None, redraw_only=False): + def update(self, affected_modules=None, redraw_only=False, force=False): now = time.time() for module in self.__modules: if affected_modules and not module.id in affected_modules: continue if not affected_modules and module.next_update: - if now < module.next_update and redraw_only: + if now < module.next_update and not force: continue if not redraw_only: