all repos — fluxbox @ 59d097bcead9b349e20a4ec193d76330e6899e53

custom fork of the fluxbox windowmanager

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
commit

59d097bcead9b349e20a4ec193d76330e6899e53

parent

541c8c407b7ba8dd10f85bb48bcb5900270b3f84

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M src/FbTk/Timer.ccsrc/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) {