aboutsummaryrefslogtreecommitdiff
path: root/src/Window.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/Window.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/Window.cc')
-rw-r--r--src/Window.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Window.cc b/src/Window.cc
index a15c6e0..1ee8853 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -550,7 +550,7 @@ void FluxboxWindow::init() {
550 550
551 m_workspacesig.emit(*this); 551 m_workspacesig.emit(*this);
552 552
553 m_creation_time = FbTk::FbTime::now(); 553 m_creation_time = FbTk::FbTime::mono();
554 554
555 frame().frameExtentSig().emit(); 555 frame().frameExtentSig().emit();
556 556
@@ -2206,7 +2206,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2206 // just after creation if the user has a saved position/size 2206 // just after creation if the user has a saved position/size
2207 if (m_creation_time) { 2207 if (m_creation_time) {
2208 2208
2209 uint64_t now = FbTk::FbTime::now(); 2209 uint64_t now = FbTk::FbTime::mono();
2210 2210
2211 Remember& rinst = Remember::instance(); 2211 Remember& rinst = Remember::instance();
2212 2212
@@ -2310,12 +2310,12 @@ void FluxboxWindow::keyPressEvent(XKeyEvent &ke) {
2310 } 2310 }
2311 2311
2312 // otherwise, make a note that the user is typing 2312 // otherwise, make a note that the user is typing
2313 m_last_keypress_time = FbTk::FbTime::now(); 2313 m_last_keypress_time = FbTk::FbTime::mono();
2314} 2314}
2315 2315
2316bool FluxboxWindow::isTyping() const { 2316bool FluxboxWindow::isTyping() const {
2317 2317
2318 uint64_t diff = FbTk::FbTime::now() - m_last_keypress_time; 2318 uint64_t diff = FbTk::FbTime::mono() - m_last_keypress_time;
2319 return ((diff / 1000) < screen().noFocusWhileTypingDelay()); 2319 return ((diff / 1000) < screen().noFocusWhileTypingDelay());
2320} 2320}
2321 2321