Changelog for Openbox:
1.3.0:
- * fix for loading autoRaiseDelay value. (Ben Jansens)
+ * make reconfigure reset the timeout values for
+ windows, the slit, and the toolbar, so that a new
+ autoRaiseDelay value will take effect without having
+ to restart. (Ben Jansens)
+
+ * fix for loading the autoRaiseDelay value. (Ben Jansens)
1.2.0:
* fix off-by-one window resizing bug. (Ben Jansens)
gettimeofday(&now, 0);
TimerList::iterator it;
- for (it = timerList.begin(); it != timerList.end(); ) {
+ for (it = timerList.begin(); it != timerList.end(); ++it) {
BTimer *timer = *it;
- ++it; // the timer may be removed from the list, so move ahead now
ASSERT(timer != NULL);
+
tm.tv_sec = timer->getStartTime().tv_sec +
timer->getTimeout().tv_sec;
tm.tv_usec = timer->getStartTime().tv_usec +
timer->fireTimeout();
// restart the current timer so that the start time is updated
- if (! timer->doOnce())
+ if (! timer->doOnce()) {
+ // reorder
+ removeTimer(timer);
+ addTimer(timer);
timer->start();
- else {
+ } else
timer->stop();
-// delete timer; // USE THIS?
- }
+ it = timerList.begin(); // we no longer have any idea if the iterator is
+ // valid, but what was at the front() is no
+ // longer.
}
}
}
void BaseDisplay::removeTimer(BTimer *timer) {
+ ASSERT(timer != (BTimer *) 0);
timerList.remove(timer);
}
frame.window = frame.pixmap = None;
timer = new BTimer(openbox, *this);
- timer->setTimeout(openbox.getAutoRaiseDelay());
+ // the time out is set in ::reconfigure()
timer->fireOnce(True);
slitmenu = new Slitmenu(*this);
}
void Slit::reconfigure(void) {
+ timer->setTimeout(openbox.getAutoRaiseDelay());
+
frame.area.setSize(0, 0);
slitClientList::const_iterator it;
_timeout.tv_usec = t;
_timeout.tv_usec -= (_timeout.tv_sec * 1000);
_timeout.tv_usec *= 1000;
+ if (timing) {
+ display.removeTimer(this);
+ display.addTimer(this); // reorder the display
+ }
}
void BTimer::setTimeout(timeval t) {
}
void BTimer::stop(void) {
- timing = False;
+ if (timing) {
+ timing = False;
- display.removeTimer(this);
+ display.removeTimer(this);
+ }
}
void BTimer::fireTimeout(void) {
hide_handler.toolbar = this;
hide_timer = new BTimer(openbox, hide_handler);
- hide_timer->setTimeout(openbox.getAutoRaiseDelay());
+ // the time out is set in ::reconfigure()
hide_timer->fireOnce(True);
image_ctrl = screen.getImageControl();
}
void Toolbar::reconfigure() {
+ hide_timer->setTimeout(openbox.getAutoRaiseDelay());
+
frame.bevel_w = screen.getBevelWidth();
frame.width = screen.size().w() * m_width_percent / 100;
windowmenu->move(windowmenu->getX(), frame.y + frame.title_h);
windowmenu->reconfigure();
}
+
+ // re-get the timeout delay
+ timer->setTimeout(openbox.getAutoRaiseDelay());
}