aboutsummaryrefslogtreecommitdiff
path: root/src/ClockTool.cc
AgeCommit message (Collapse)AuthorFilesLines
2021-07-06Patch from Bo Simonsen.Mark Tiefenbruck1-4/+9
Improve switching between 12H and 24H in Clock Tool configuration Having: session.screen0.strftimeFormat: %d-%m-%y %02k:%M The switch[1] between 12H and 24H did not work due to the digits (02).
2015-01-15Refactor menu code: be more explicit and compactMathias Gumz1-7/+3
This commit is a preparation step for some menu cleanup ahead. To make it easier to understand which types of MenuItems are added where and when, I converted the overloaded FbTk::Menu::insert() functions into explicit ones (Menu::insertSubmenu(), Menu::insertItem(), etc. ). This makes it possible to just grep for 'insertSubmenu()'. Side effect this commit: it trims down the very verbose creation of menu items in regards to how the labels are created. Minor: FbTk::Menu::shown and FbTk::Menu::s_focused are moved out of the class.
2014-05-12cosmetic, less codeMathias Gumz1-9/+10
2014-05-12detect minute-based strftime-formats (again)Mathias Gumz1-3/+11
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.
2014-05-12fix clocktool lagging behind and skipping secondsMathias Gumz1-2/+13
from time to time (...) time() might be off to gettimeofday() by a second. the reason for this is that time() is usually implemented by just returning the field 'second' of the struct that represents the clock inside the kernel. gettimeofday() on the other hand also takes the 'fraction' field (mostly 'nanoseconds') into account and thus is closer to the current time than time(). the result of using time() was a perceived 'lag', sometimes the clocktool even skipped a second. by using FbTk::FbTime()::system() instead fixes the issue.
2013-05-26build-sys: include config.h to all files using automakeSami Kerola1-4/+0
Do not try to be too smart which compilations need config.h, as most of them will simply because of the config.h has information about system capabilities.
2013-02-14Trigger ClockTool every second, independent of the format stringMathias Gumz1-53/+36
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.
2013-01-26Calculates timeouts of ClockTool based upon System ClockMathias Gumz1-4/+5
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.
2012-09-14minor cosmeticMathias Gumz1-3/+4
2012-08-28changed timing functions to use a monotonic increasing clockMathias Gumz1-25/+12
gettimeofday() is subject to be changed on daylight-saving or to ntp-related (think leap-seconds). even worse, it is subject to be changed BACK in time. this is hard to fix correctly (see commit 45726d3016e and bug #3560509). it is irrelevant for timers to know the nano-seconds since the epoch anyways.
2011-05-10Convert ToolbarItem::resizeSig to FbTk::SignalPavel Labath1-2/+2
2011-05-10Convert FbTk::Theme::reconfigSig and friends to the new Signal systemPavel Labath1-5/+6
I removed the const versions of reconfigSig() in the process since FbTk::Signal has no const methods anyway.
2011-02-22bugfix: consistent use of 'int' for alpha values (#3187373)Mathias Gumz1-1/+1
WindowMenuAccessor returned strange alpha values if compiled with 'g++ -Os'; unholy black magic happens if template<int> faces functions returning only 'usigned char'.
2010-09-08introduced FbTk::BidiStringMathias Gumz1-5/+5
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
2010-09-05avoid constructing new strings implicitMathias Gumz1-1/+1
2010-08-24code simplification / deduplicationMathias Gumz1-54/+34
* parse the string only once for a bunch of chars to check instead of starting over again and again from the beginning, created a helper function to do this (FbTk::StringUtil::findCharFromAlphabetAfterTrigger) * put same code into a function (setClockModeLabel()) * use much simpler code to switch between 12h and 24h mode and replace the fmt-switches
2010-08-23fixed compiler warning 'comparison between signed and unsigned integer ↵Mathias Gumz1-7/+7
expressions'
2010-01-19optimization of how often fluxbox checks for the system time to display it ↵Mathias Gumz1-4/+46
in the clocktool the idea (as a first patch) for this change was provided by Thomas Habets (thomas at habets pp se). instead of having a fixed interval each second, we now calculate the next point in time based upon the format string used by the clocktool to render the time. as long as no seconds are shown fluxbox now wakes up once every minute.
2008-01-15split Text.hh into Orientation.hh and TextUtils.{cc,hh}Mathias Gumz1-0/+1
2008-01-11make FbTk::Command a template class, split parsing information out of ↵Mark Tiefenbruck1-6/+6
ObjectRegistry
2008-01-05update code to use ThemeProxyMark Tiefenbruck1-15/+13
2008-01-04remove old svn $Id$ tagsMark Tiefenbruck1-2/+0
2007-12-30removed some unneeded headersMathias Gumz1-13/+12
2007-12-18holding control will now keep the menu openMark Tiefenbruck1-2/+3
2007-12-16changed CommandRegistry to a template class, renamed to ObjectRegistry<Type>Mark Tiefenbruck1-3/+3
2007-12-13added FbTk::CommandRegistry, decentralized command parsing, and made them ↵markt1-3/+3
auto-register
2007-10-13merged changes from pre-develmarkt1-2/+2
2007-04-08use proper test for whether it's a number.simonb1-1/+1
2007-04-08Only replace numbers with zeros when calculating clock width.simonb1-1/+11
Otherwise width of things in proportional fonts can be way out. sf.net bug #1545066.
2007-01-05use LC_TIME for interpreting clock locale.simonb1-4/+16
Fix something likely to break locales on BSDs and things without nl_langinfo
2006-06-21fix nls... notably classify text on conversion whether its for X or simonb1-5/+5
console, plus handle catalogs better.
2006-06-19fix timer issues (esp clock not updating on multiple screens)simonb1-1/+4
2006-04-24Use -Wall when --enable-debug and some warning fixes simonb1-1/+1
+ thanks Jonas Koelker
2006-04-18don't check the clock so often...simonb1-5/+2
2006-04-17grow the clock if the text gets too bigsimonb1-1/+9
2006-04-15implement vertical toolbar placement optionssimonb1-4/+13
2006-03-02fixed gcc4.1 problems, patch from Andreas Bierfert <andreas dot bierfert at ↵mathias1-1/+1
lowlatency dot de>
2006-02-16updated copyright infomathias1-1/+1
2005-06-30if we check the time only ever second we can get into trouble, eg:mathias1-3/+4
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.
2005-05-12missing #include <typeinfo>mathias1-0/+1
2005-04-27fix a few more bugs with recent reworking stuffsimonb1-17/+15
Some fixes could incidentally fix a few other bugs... the flaws were pre-existing, I've just been weeding out a lot of duplication
2005-04-26extension of previous big patch. Move a bunch of menu things onto simonb1-0/+1
background pixmap. Same for textbuttons.
2005-01-24copyright datemathias1-1/+1
2004-12-10changing the timeformat of the clocktool is done via the editdialog which mathias1-1/+3
causes a reconfigure .. which causes a loop over all toolbaritems and call updateSizing() .. where we should check, if a new timeformat makes the clock bigger or smaller... closes #1026096
2004-12-07minor cosmetic issueRelease-0_9_11mathias1-3/+1
2004-11-19svn propset svn:keywords "Id"mathias1-1/+1
2004-10-10 * Update de_DE Translation and add some missing NLS valuesrathnor1-6/+13
(Thanks Christian Storm) - also a tiny cleanup of weird nls set
2004-09-12preliminary support for composite/compositing manager. Also general workrathnor1-11/+20
for consistency with transparency resources
2004-08-31add autoconf check for std c++ headersrathnor1-2/+6
2004-08-29a few random fixesrathnor1-1/+6