polybar-dwm/include/modules/meta
Malte Bargholz a625e2b79a
fix(timer_module): sleep until next full interval (#2123)
Any timer_module based module would sleep for the set interval and then
continue running. Depending on the start time of polybar this
sleep pattern might not be aligned, which causes such modules to always
update in a shifted manner.
Consider the date module as an example. If the update interval is set to
60 seconds and polybar was started at 13:37:37, polybar would update the
clock at 13:38:37, 13:39:37 and so on.
To make matters worse, if a module would perform lengthy checks this
interval might drift over time, causing even more inconsistent updating.

This patch extends the base module with a sleep_until method that calls
the corresponding function on the sleephandler. Additionally the
timer_module is extended to compute the remaining time until the next
interval passes and sleep accordingly.

Closes #2064

Co-developed-by: Dominik Töllner <dominik.toellner@stud.uni-hannover.de>

Co-authored-by: Malte Bargholz <malte@screenri.de>
2020-06-20 22:15:25 +02:00
..
base.hpp fix(timer_module): sleep until next full interval (#2123) 2020-06-20 22:15:25 +02:00
base.inl fix(timer_module): sleep until next full interval (#2123) 2020-06-20 22:15:25 +02:00
event_handler.hpp refactor(event_handler): Abstract sink attaching 2016-12-23 05:08:19 +01:00
event_module.hpp fix(modules): Warmup in runner thread to avoid block 2017-01-27 13:29:10 +01:00
factory.hpp fix(alsa): use correct module_name 2018-02-11 17:04:08 +01:00
inotify_module.hpp fix(modules): Warmup in runner thread to avoid block 2017-01-27 13:29:10 +01:00
input_handler.hpp refactor(modules): Input handling 2016-12-23 20:43:52 +01:00
static_module.hpp fix(xwindow): Lock mutexes on update #416 2017-02-05 13:37:16 +01:00
timer_module.hpp fix(timer_module): sleep until next full interval (#2123) 2020-06-20 22:15:25 +02:00