From 9b88b1f2c7e2da1ec6a47518ded37c0eab36e738 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 19 Dec 2003 13:37:28 +0000 Subject: reconfig timer back, needs to have a timer so we can reconfig fluxbox save in the next event round, see comments... --- src/fluxbox.cc | 28 +++++++++++++++++++--------- src/fluxbox.hh | 4 +++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/fluxbox.cc b/src/fluxbox.cc index c831713..4210f47 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.209 2003/12/19 03:58:36 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.210 2003/12/19 13:37:28 fluxgen Exp $ #include "fluxbox.hh" @@ -409,7 +409,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile m_focus_revert_screen(0) { - + if (s_singleton != 0) throw string("Fatal! There can only one instance of fluxbox class."); @@ -438,6 +438,19 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile sigh.registerHandler(SIGHUP, this); sigh.registerHandler(SIGUSR1, this); sigh.registerHandler(SIGUSR2, this); + // + // setup timer + // This timer is used to we can issue a safe reconfig command. + // Because when the command is executed we shouldn't do reconfig directly + // because it could affect ongoing menu stuff so we need to reconfig in + // the next event "round". + FbTk::RefCount reconfig_cmd(new FbTk::SimpleCommand(*this, &Fluxbox::timed_reconfigure)); + timeval to; + to.tv_sec = 0; + to.tv_usec = 1; + m_reconfig_timer.setTimeout(to); + m_reconfig_timer.setCommand(reconfig_cmd); + m_reconfig_timer.fireOnce(true); Display *disp = FbTk::App::instance()->display(); @@ -931,9 +944,8 @@ void Fluxbox::handleEvent(XEvent * const e) { #ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<") Focus out is not a FluxboxWindow !!"< m_key; //default arguments for titlebar left and right -- cgit v0.11.2