diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-02-01 19:36:20 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-02-01 19:36:30 (GMT) |
commit | 3e4ee48bf16be6925b7c35ab8bd73bd962c674d8 (patch) | |
tree | f2f8d2a76f4df5c27467d875546402075c578740 /src/FbTk/Timer.cc | |
parent | dc47491533e0ca7cf5a5386a10e68fbaf873e9db (diff) | |
download | fluxbox_pavel-3e4ee48bf16be6925b7c35ab8bd73bd962c674d8.zip fluxbox_pavel-3e4ee48bf16be6925b7c35ab8bd73bd962c674d8.tar.bz2 |
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.
Diffstat (limited to 'src/FbTk/Timer.cc')
-rw-r--r-- | src/FbTk/Timer.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc index 1bec893..422e9c6 100644 --- a/src/FbTk/Timer.cc +++ b/src/FbTk/Timer.cc | |||
@@ -58,8 +58,12 @@ | |||
58 | namespace { | 58 | namespace { |
59 | 59 | ||
60 | struct TimerCompare { | 60 | struct TimerCompare { |
61 | bool operator() (const FbTk::Timer* a, const FbTk::Timer* b) { | 61 | // stable sort order and allows multiple timers to have |
62 | return a->getEndTime() < b->getEndTime(); | 62 | // the same end-time |
63 | bool operator() (const FbTk::Timer* a, const FbTk::Timer* b) const { | ||
64 | uint64_t ae = a->getEndTime(); | ||
65 | uint64_t be = b->getEndTime(); | ||
66 | return (ae < be) || (ae == be && a < b); | ||
63 | } | 67 | } |
64 | }; | 68 | }; |
65 | typedef std::set<FbTk::Timer*, TimerCompare> TimerList; | 69 | typedef std::set<FbTk::Timer*, TimerCompare> TimerList; |