From 79589fd99eaaa7a911f6146f21337c105f3ab446 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 15 Jul 2011 20:54:59 +0200 Subject: Attach modifiedSig handlers to the session.autoRaiseDelay resource --- src/Toolbar.cc | 5 ++++- src/Window.cc | 6 +++--- src/fluxbox.hh | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 1be8215..3919a19 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -219,7 +219,10 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width): frame.grab_x = frame.grab_y = 0; // setup hide timer - m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); + m_hide_timer.setTimeout(*Fluxbox::instance()->getAutoRaiseDelayResource()); + m_signal_tracker.join(Fluxbox::instance()->getAutoRaiseDelayResource().modifiedSig(), + FbTk::MemFun(m_hide_timer, + static_cast(&FbTk::Timer::setTimeout) ) ); FbTk::RefCount > toggle_hidden(new FbTk::SimpleCommand(*this, &Toolbar::toggleHidden)); m_hide_timer.setCommand(toggle_hidden); m_hide_timer.fireOnce(true); diff --git a/src/Window.cc b/src/Window.cc index 474f839..9974bc5 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -419,7 +419,9 @@ void FluxboxWindow::init() { updateMWMHintsFromClient(*m_client); - m_timer.setTimeout(fluxbox.getAutoRaiseDelay()); + m_timer.setTimeout(*fluxbox.getAutoRaiseDelayResource()); + join(fluxbox.getAutoRaiseDelayResource().modifiedSig(), FbTk::MemFun(m_timer, + static_cast(&FbTk::Timer::setTimeout) ) ); FbTk::RefCount > raise_cmd(new FbTk::SimpleCommand(*this, &FluxboxWindow::raise)); m_timer.setCommand(raise_cmd); @@ -1053,8 +1055,6 @@ void FluxboxWindow::reconfigure() { moveResize(frame().x(), frame().y(), frame().width(), frame().height()); - m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); - updateButtons(); frame().reconfigure(); diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 20b25fb..c25939d 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -127,7 +127,8 @@ public: FbTk::IntResource &getTabsPaddingResource() { return m_rc_tabs_padding; } - time_t getAutoRaiseDelay() const { return *m_rc_auto_raise_delay; } + FbTk::Resource > & + getAutoRaiseDelayResource() { return m_rc_auto_raise_delay; } FbTk::UIntResource &getCacheLifeResource() { return m_rc_cache_life; } FbTk::UIntResource &getCacheMaxResource() { return m_rc_cache_max; } -- cgit v0.11.2