Fix bug: (re)setting timeouts on a running FbTk::Timer might lead to broken timer list Setting a new timeout on a running FbTk::Timer must remove it from the timerlist, otherwise the list is not ordered correctly anymore. So, we stop the running FbTk::Timer, set the new timeout and restart it.
Mathias Gumz akira at fluxbox dot org
1 files changed,
9 insertions(+),
0 deletions(-)
jump to
M
src/FbTk/Timer.cc
→
src/FbTk/Timer.cc
@@ -112,7 +112,16 @@ }
void Timer::setTimeout(uint64_t timeout) { + + bool was_timing = isTiming(); + if (was_timing) { + stop(); + } m_timeout = timeout; + + if (was_timing) { + start(); + } } void Timer::setCommand(const RefCount<Slot<void> > &cmd) {