aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Timer.cc
AgeCommit message (Collapse)AuthorFilesLines
2014-05-12detect minute-based strftime-formats (again)Mathias Gumz1-2/+2
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.
2013-05-26build-sys: use AC_USE_SYSTEM_EXTENSIONSSami Kerola1-5/+0
The earlier _GNU_SOURCE definitions possibly did not take effect everywhere where it was intended.
2013-02-13Initialize FbTk::Timer.m_timeout correctlyMathias Gumz1-2/+4
2013-02-10CleanupMathias Gumz1-29/+29
2013-02-01Fix regression regarding timers with equal end-timeMathias Gumz1-2/+6
std::set<Key, Comp> stores Key only if Comp(Key) yields a unique result (My mistake: I was under the impression Comp is only used for the ordering). This prevents FbTk::Timers with equal end-times from actually being started. Escpecially in situation with multiple ClockTools this lead to stopped timers (see bug #3600694). Kudos to Adam Majer for enlightening discussions.
2013-01-26Calculates timeouts of ClockTool based upon System ClockMathias Gumz1-3/+3
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.
2013-01-15Simplifies and fix bugs in FbTk::TimerMathias Gumz1-38/+34
* Calling Timer::setTimeout() from within Timer::start() might lead to ugly behavior (as experienced in bugs #3590078, #3600143, etc; see commit 4d307dcd10af9d817ff5c05fc40ae7487564cb31, fixes the problem partially). * Stop a timer first, then call the handler (via Timer::fireTimeout()). A given handler might call Timer::start() again, which (re)adds the Timer to the control list .. the following Timer::stop() would remove it again. * Use 'm_start' as indicator if timer is running. * Move the (now quite short) code of ::addTimer / ::removeTimer into the Timer::start() and Timer::stop() functions.
2013-01-13Minor optimization of handling the timersMathias Gumz1-15/+15
2013-01-12Fix bug: handle the list of Timers not in-placeMathias Gumz1-14/+18
With commit 541c8c4 we switched from an (manually) ordered list to a std::set<> to handle the active timers. The code which checks for overdue timers now traverses and modifies the std::set<> in place. This might lead to an infinite loop. Examples of such bad behavior are "flickering of the tooltip" (bug #3590078) or crashes (bug #3600143) or just insanely high cpu load when autoraising windows or submenus. We now make a copy of the std::set<> traverse this instead of the original.
2012-09-14minor cosmeticMathias Gumz1-4/+2
2012-09-14Fix regression: switch back to microseconds for DelayCmdMathias Gumz1-5/+5
2012-09-14Fix bug: (re)setting timeouts on a running FbTk::Timer might lead to broken ↵Mathias Gumz1-0/+9
timer list Setting a new timeout on a running FbTk::Timer must remove it from the timerlist, otherwise the list is not ordered correctly anymore. So, we stop the running FbTk::Timer, set the new timeout and restart it.
2012-08-28changed timing functions to use a monotonic increasing clockMathias Gumz1-145/+87
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.
2012-01-04Pre-increment non-primitive types.Ryan Pavlik1-1/+1
Found with cppcheck: "Prefix ++/-- operators should be preferred for non-primitive types. Pre-increment/decrement can be more efficient than post-increment/decrement. Post-increment/decrement usually involves keeping a copy of the previous value around and adds a little extra code."
2011-10-31FbTk/Timer.cc: Check HAVE_SYS_SELECT_H, add alternate for windowsRyan Pavlik1-0/+2
2011-10-31FbTk/Timer.cc: Check HAVE_SYS_SELECT_HRyan Pavlik1-1/+3
2011-09-14Upgrade FbTk::Timer so it can take an arbitrary functor as a parameterPavel Labath1-2/+6
2011-09-14FbTk::Timer accepts Slots instead of Commands as the former are more generalPavel Labath1-4/+4
2011-05-10Make RefCount<> more sensiblePavel Labath1-3/+3
the previous version of operator*() made no sense. E.g., it violated the invariant (*ptr).foo <=> ptr->foo. The dereferencing operator now returns a reference to the pointed-to object, rather than a pointer to it. I also added a bool conversion operator, which can be used in testing the NULL-ness of the pointer. Anyone wondering if that could be done in a simpler way is encouraged to read <http://www.artima.com/cppsource/safebool.html>. And, finally, I removed the mutable flag from the m_data member, since it does not need it.
2010-09-09simpler to use FbTk/Timer apiMathias Gumz1-0/+5
2010-05-06compile fix: FD_ZERO (sys/select.h) on solaris wants to use memset(); closes ↵Mathias Gumz1-4/+10
#2997117
2010-01-19improved documentation of the codeMathias Gumz1-5/+8
2009-10-08reportedly fix compiling on gcc 4.4 on SolarisMark Tiefenbruck1-0/+2
2008-08-21fix parsing of Delay commandMark Tiefenbruck1-1/+2
2008-04-21some fixes for gcc 3.4Thomas Orgis1-1/+1
2008-01-11make FbTk::Command a template class, split parsing information out of ↵Mark Tiefenbruck1-7/+7
ObjectRegistry
2007-12-28moved DelayedCmd from Screen.cc to FbTk/Timer.cc, added it to the keys fileMark Tiefenbruck1-1/+37
2006-06-19fix timer issues (esp clock not updating on multiple screens)simonb1-42/+41
2006-04-18don't check the clock so often...simonb1-15/+47
2006-02-16updated copyright infomathias1-1/+1
2005-01-24copyright datemathias1-1/+1
2004-11-01accepted patch #1057446, improved iterator in timer-codeakir1-6/+15
2004-10-19if the systemtime is set back the timers wont be updated.akir1-4/+21
solution: add the delta to all of our timers too.
2004-09-19fixed a minor bug that can lead to HIGH cpuload under some circumstances.akir1-1/+2
actually we must ensure that only timers with a valid handle are added to the timerslist.
2004-08-31add autoconf check for std c++ headersrathnor1-1/+5
2003-10-05fix reading of auto raise delayrathnor1-1/+1
2003-08-11executing a command on timeout instead of calling a TimeoutHandlerfluxgen1-3/+13
2003-01-09moved from fluxbox to fbtkfluxgen1-0/+182