This fixes#857 and #1932. Also replaces PR #1725, since we don't need
our own implementation of condition_variable anymore since people who
update their polybar should have GCC 10 by now.
The m_updated_at field of the mpd module was removed instead of having
its clock change because it became unused in commit 645a3142a1.
Before it was enabled by default. That means if the constructor fails,
the destructor will complain that the module was not stopped before
deconstructing.
We can't just call stop if module creation fails because the module is
only partially initialized.
* build: Add -Wsuggest-override
We should always use the override specifier when overriding virtual
functions. This helps prevent errors when a subclass tries to create a
function with the same name as a virtual function in a super-class but
with a different purpose.
* clang-format
* Upload logs on failure
* Add override to unsupported.hpp
* cmake: Make -Wsuggest-override flag conditional
Since 3.5.0, we use m_interval for a modulo operation, this crashes the
bar if the interval is 0. A non-positive interval shouldn't be allowed
anyway, so we now throw an exception in that case.
Fixes#2273
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>