simpler to use FbTk/Timer api
Mathias Gumz akira at fluxbox dot org
3 files changed,
8 insertions(+),
5 deletions(-)
M
src/AttentionNoticeHandler.cc
→
src/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.cc
→
src/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.hh
→
src/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