aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2013-01-26 08:21:47 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2013-01-26 08:21:47 (GMT)
commit716532dd47d718cb548da5f65b53a8b744ce235f (patch)
tree683de0875820ce361e2c02efc69d3ad103f3f90a /src/FbTk/Timer.cc
parente7bfc639323bf5d4b207323b6e2fd275dcb5d825 (diff)
downloadfluxbox-716532dd47d718cb548da5f65b53a8b744ce235f.zip
fluxbox-716532dd47d718cb548da5f65b53a8b744ce235f.tar.bz2
Calculates timeouts of ClockTool based upon System Clock
Users expect time switches to happen upon system clock times. Calculating the timeout for the next refresh of the shown time via the monotonic clock is wrong: The monotonic clock yields values based upon some arbitrary point in time which might be off a little bit to the system clock, a 'full' minute of the monotonic clock might be in the midst of a system clock minute.
Diffstat (limited to 'src/FbTk/Timer.cc')
-rw-r--r--src/FbTk/Timer.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc
index 2404773..1bec893 100644
--- a/src/FbTk/Timer.cc
+++ b/src/FbTk/Timer.cc
@@ -117,7 +117,7 @@ void Timer::start() {
117 // it from s_timerlist before restarting it 117 // it from s_timerlist before restarting it
118 stop(); 118 stop();
119 119
120 m_start = FbTk::FbTime::now(); 120 m_start = FbTk::FbTime::mono();
121 121
122 // interval timers have their timeout change every 122 // interval timers have their timeout change every
123 // time they are started! 123 // time they are started!
@@ -158,7 +158,7 @@ void Timer::updateTimers(int fd) {
158 FD_SET(fd, &rfds); 158 FD_SET(fd, &rfds);
159 159
160 bool overdue = false; 160 bool overdue = false;
161 uint64_t now = FbTime::now(); 161 uint64_t now = FbTime::mono();
162 uint64_t end_time; 162 uint64_t end_time;
163 163
164 // search for overdue timers 164 // search for overdue timers
@@ -192,7 +192,7 @@ void Timer::updateTimers(int fd) {
192 192
193 static std::vector<FbTk::Timer*> timeouts; 193 static std::vector<FbTk::Timer*> timeouts;
194 194
195 now = FbTime::now(); 195 now = FbTime::mono();
196 for (it = s_timerlist.begin(); it != s_timerlist.end(); ++it ) { 196 for (it = s_timerlist.begin(); it != s_timerlist.end(); ++it ) {
197 if (now < (*it)->getEndTime()) { 197 if (now < (*it)->getEndTime()) {
198 break; 198 break;