all repos — fluxbox @ e68511794130388ab9668fdef0dcf48dbbf002fd

custom fork of the fluxbox windowmanager

simpler to use FbTk/Timer api
Mathias Gumz akira at fluxbox dot org
commit

e68511794130388ab9668fdef0dcf48dbbf002fd

parent

82d0de9ef46d38288d2f1daa77ac18276d57390f

3 files changed, 8 insertions(+), 5 deletions(-)

jump to
M src/AttentionNoticeHandler.ccsrc/AttentionNoticeHandler.cc

@@ -78,14 +78,11 @@ // disable if timeout is zero

if (**timeout_res == 0) return; - Timer *timer = new Timer(); // setup timer - timeval timeout; - timeout.tv_sec = 0; - timeout.tv_usec = **timeout_res * 1000; RefCount<Command<void> > cmd(new ToggleFrameFocusCmd(client)); + Timer *timer = new Timer(); timer->setCommand(cmd); - timer->setTimeout(timeout); + timer->setTimeout(0, **timeout_res * 1000); timer->fireOnce(false); // will repeat until window has focus timer->start();
M src/FbTk/Timer.ccsrc/FbTk/Timer.cc

@@ -85,6 +85,11 @@ m_timeout.tv_sec = t.tv_sec;

m_timeout.tv_usec = t.tv_usec; } +void Timer::setTimeout(unsigned int secs, unsigned int usecs) { + m_timeout.tv_sec = secs; + m_timeout.tv_usec = usecs; +} + void Timer::setCommand(RefCount<Command<void> > &cmd) { m_handler = cmd; }
M src/FbTk/Timer.hhsrc/FbTk/Timer.hh

@@ -64,6 +64,7 @@ /// set timeout

void setTimeout(time_t val); /// set timeout void setTimeout(const timeval &val); + void setTimeout(unsigned int secs, unsigned int usecs); void setCommand(RefCount<Command<void> > &cmd); void setInterval(int val) { m_interval = val; } /// start timing