all repos — fluxbox @ 3e4ee48bf16be6925b7c35ab8bd73bd962c674d8

custom fork of the fluxbox windowmanager

Fix regression regarding timers with equal end-time

std::set<Key, Comp> stores Key only if Comp(Key) yields a unique result (My
mistake: I was under the impression Comp is only used for the ordering). This
prevents FbTk::Timers with equal end-times from actually being started.
Escpecially in situation with multiple ClockTools this lead to stopped timers
(see bug #3600694).

Kudos to Adam Majer for enlightening discussions.
Mathias Gumz akira at fluxbox dot org
commit

3e4ee48bf16be6925b7c35ab8bd73bd962c674d8

parent

dc47491533e0ca7cf5a5386a10e68fbaf873e9db

1 files changed, 6 insertions(+), 2 deletions(-)

jump to
M src/FbTk/Timer.ccsrc/FbTk/Timer.cc

@@ -58,8 +58,12 @@

namespace { struct TimerCompare { - bool operator() (const FbTk::Timer* a, const FbTk::Timer* b) { - return a->getEndTime() < b->getEndTime(); + // stable sort order and allows multiple timers to have + // the same end-time + bool operator() (const FbTk::Timer* a, const FbTk::Timer* b) const { + uint64_t ae = a->getEndTime(); + uint64_t be = b->getEndTime(); + return (ae < be) || (ae == be && a < b); } }; typedef std::set<FbTk::Timer*, TimerCompare> TimerList;