aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-02-01 19:36:20 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-02-01 19:36:30 (GMT)
commit3e4ee48bf16be6925b7c35ab8bd73bd962c674d8 (patch)
treef2f8d2a76f4df5c27467d875546402075c578740
parentdc47491533e0ca7cf5a5386a10e68fbaf873e9db (diff)
downloadfluxbox-3e4ee48bf16be6925b7c35ab8bd73bd962c674d8.zip
fluxbox-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.
-rw-r--r--src/FbTk/Timer.cc8
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 @@
58namespace { 58namespace {
59 59
60struct TimerCompare { 60struct 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};
65typedef std::set<FbTk::Timer*, TimerCompare> TimerList; 69typedef std::set<FbTk::Timer*, TimerCompare> TimerList;