aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2014-05-12 10:17:00 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2014-05-12 10:17:00 (GMT)
commit948e63eb600e173815a9ddedd2951db56fe51611 (patch)
treea4a96c0cc8f97d200a13e74c45c4f7dc8b1de550 /src/FbTk
parent913244789fac779d8c4ce719d3e9534312feacc2 (diff)
downloadfluxbox-948e63eb600e173815a9ddedd2951db56fe51611.zip
fluxbox-948e63eb600e173815a9ddedd2951db56fe51611.tar.bz2
detect minute-based strftime-formats (again)
the lag / skipping of the clock was not caused by faulty timer code on fluxbox's side but by the behavior and inner workings of time(). since this is fixed now (913244789f) we can now rollback ec7fe513c8 and detect strftime-formats which need intervals of seconds or minutes. minor: the small change to FbTk::Timer::setTimeout() reduces one start() / stop() cycle for a running timer.
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Timer.cc4
-rw-r--r--src/FbTk/Timer.hh2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc
index 1806557..61875f7 100644
--- a/src/FbTk/Timer.cc
+++ b/src/FbTk/Timer.cc
@@ -91,7 +91,7 @@ Timer::~Timer() {
91} 91}
92 92
93 93
94void Timer::setTimeout(uint64_t timeout) { 94void Timer::setTimeout(uint64_t timeout, bool force_start) {
95 95
96 bool was_timing = isTiming(); 96 bool was_timing = isTiming();
97 if (was_timing) { 97 if (was_timing) {
@@ -99,7 +99,7 @@ void Timer::setTimeout(uint64_t timeout) {
99 } 99 }
100 m_timeout = timeout; 100 m_timeout = timeout;
101 101
102 if (was_timing) { 102 if (force_start || was_timing) {
103 start(); 103 start();
104 } 104 }
105} 105}
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh
index 4bdd13a..8904a85 100644
--- a/src/FbTk/Timer.hh
+++ b/src/FbTk/Timer.hh
@@ -43,7 +43,7 @@ public:
43 ~Timer(); 43 ~Timer();
44 44
45 void fireOnce(bool once) { m_once = once; } 45 void fireOnce(bool once) { m_once = once; }
46 void setTimeout(uint64_t timeout); 46 void setTimeout(uint64_t timeout, bool force_start = false);
47 void setCommand(const RefCount<Slot<void> > &cmd); 47 void setCommand(const RefCount<Slot<void> > &cmd);
48 48
49 template<typename Functor> 49 template<typename Functor>