diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2013-02-14 18:58:14 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2013-02-14 18:58:28 (GMT) |
commit | ec7fe513c8ca241836fab4632fc56faedd0f1863 (patch) | |
tree | 5730015ada46c7f64952fd57edefca50674979fc /src/ClockTool.hh | |
parent | ac27c8cb4235b548ac1d1a5d5472d04a198bddf2 (diff) | |
download | fluxbox-ec7fe513c8ca241836fab4632fc56faedd0f1863.zip fluxbox-ec7fe513c8ca241836fab4632fc56faedd0f1863.tar.bz2 |
Trigger ClockTool every second, independent of the format string
It's hard to hit right moment to update the clock correctly: Either we are a
bit too early and the 'old time' is the same as the 'new time' and the clock
looks 'a bit off' or we are too late and the clock is 'a bit off'. This is
especially the case for format strings which do not show the second and thus
are updated only at the full minute (see bug #1082): if fluxbox does not
update the clock 'now' it would do it one minute later and thus the clock
might show the wrong time for roughly 1 minute.
Instead of coming up with something immensely clever we just trigger the
ClockTool every second. If no update of the shown time is needed fluxbox won't
do anything.
Some minor code reordering as byproduct.
Diffstat (limited to 'src/ClockTool.hh')
-rw-r--r-- | src/ClockTool.hh | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ClockTool.hh b/src/ClockTool.hh index 4f89b36..2872f33 100644 --- a/src/ClockTool.hh +++ b/src/ClockTool.hh | |||
@@ -72,18 +72,16 @@ private: | |||
72 | void reRender(); | 72 | void reRender(); |
73 | void updateSizing(); | 73 | void updateSizing(); |
74 | 74 | ||
75 | FbTk::TextButton m_button; | 75 | FbTk::TextButton m_button; |
76 | 76 | ||
77 | const FbTk::ThemeProxy<ToolTheme> &m_theme; | 77 | const FbTk::ThemeProxy<ToolTheme>& m_theme; |
78 | BScreen &m_screen; | 78 | BScreen& m_screen; |
79 | Pixmap m_pixmap; | 79 | Pixmap m_pixmap; |
80 | FbTk::Timer m_timer; | 80 | FbTk::Timer m_timer; |
81 | 81 | ||
82 | FbTk::Resource<std::string> m_timeformat; | 82 | FbTk::Resource<std::string> m_timeformat; |
83 | 83 | FbTk::StringConvertor m_stringconvertor; | |
84 | FbTk::StringConvertor m_stringconvertor; | 84 | FbTk::SignalTracker m_tracker; |
85 | |||
86 | FbTk::SignalTracker m_tracker; | ||
87 | }; | 85 | }; |
88 | 86 | ||
89 | #endif // CLOCKTOOL_HH | 87 | #endif // CLOCKTOOL_HH |