diff options
author | mathias <mathias> | 2005-06-30 08:38:53 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-06-30 08:38:53 (GMT) |
commit | 66a241cc43b53c8a3e7d70b0c929c0d672bd65c7 (patch) | |
tree | 02f1f512420ebe21cfd030d4998e3a8bc3399660 | |
parent | a5310fae340126b1e98a874067f5eec7ddd025be (diff) | |
download | fluxbox-66a241cc43b53c8a3e7d70b0c929c0d672bd65c7.zip fluxbox-66a241cc43b53c8a3e7d70b0c929c0d672bd65c7.tar.bz2 |
if we check the time only ever second we can get into trouble, eg:
assume its 12:34:56.99, displaying 12:34:56 takes some time and so its already
12:34:57 when we display 12:34:56. to fix that i set the time to check the
clock to 0.01 seconds. that shouldnt hurt much since we only redraw the clock
when the string has changed.
a more complex approach would be to analyze the strftime-string and set the
timeout accordingly. but i dont know if its really worth the effort and beeing
a bit off schedule can happen too, just not as often as if you are in seconds
mode.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/ClockTool.cc | 7 |
2 files changed, 7 insertions, 3 deletions
@@ -1,5 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.14: | 2 | Changes for 0.9.14: |
3 | *05/06/30: | ||
4 | * Fix for clock displaying %S too late sometimes (Mathias) | ||
5 | ClockTool.cc | ||
3 | *05/06/28: | 6 | *05/06/28: |
4 | * Fix for toggling the toolbar doesnt update strut (thanx C. Monti) | 7 | * Fix for toggling the toolbar doesnt update strut (thanx C. Monti) |
5 | * Little reordering of ToolbarMenu items (Mathias) | 8 | * Little reordering of ToolbarMenu items (Mathias) |
diff --git a/src/ClockTool.cc b/src/ClockTool.cc index 709abd8..cf56da7 100644 --- a/src/ClockTool.cc +++ b/src/ClockTool.cc | |||
@@ -148,10 +148,11 @@ ClockTool::ClockTool(const FbTk::FbWindow &parent, | |||
148 | 148 | ||
149 | _FB_USES_NLS; | 149 | _FB_USES_NLS; |
150 | 150 | ||
151 | // setup timer to update the graphics each second | 151 | // setup timer to check the clock every 0.01 second |
152 | // if nothing has changed, it wont update the graphics | ||
152 | timeval delay; | 153 | timeval delay; |
153 | delay.tv_sec = 1; | 154 | delay.tv_sec = 0; |
154 | delay.tv_usec = 0; | 155 | delay.tv_usec = 100000; |
155 | m_timer.setTimeout(delay); | 156 | m_timer.setTimeout(delay); |
156 | FbTk::RefCount<FbTk::Command> update_graphic(new FbTk::SimpleCommand<ClockTool>(*this, | 157 | FbTk::RefCount<FbTk::Command> update_graphic(new FbTk::SimpleCommand<ClockTool>(*this, |
157 | &ClockTool::updateTime)); | 158 | &ClockTool::updateTime)); |