aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Toolbar.cc8
-rw-r--r--src/Toolbar.hh1
-rw-r--r--src/Window.cc9
-rw-r--r--src/Window.hh2
-rw-r--r--src/fluxbox.hh3
5 files changed, 18 insertions, 5 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 0899988..d43b0ca 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -219,7 +219,9 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width):
219 frame.grab_x = frame.grab_y = 0; 219 frame.grab_x = frame.grab_y = 0;
220 220
221 // setup hide timer 221 // setup hide timer
222 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); 222 autoRaiseDelayChanged(*Fluxbox::instance()->getAutoRaiseDelayResource());
223 m_signal_tracker.join(Fluxbox::instance()->getAutoRaiseDelayResource().modifiedSig(),
224 FbTk::MemFun(*this, &Toolbar::autoRaiseDelayChanged) );
223 FbTk::RefCount<FbTk::Command<void> > toggle_hidden(new FbTk::SimpleCommand<Toolbar>(*this, &Toolbar::toggleHidden)); 225 FbTk::RefCount<FbTk::Command<void> > toggle_hidden(new FbTk::SimpleCommand<Toolbar>(*this, &Toolbar::toggleHidden));
224 m_hide_timer.setCommand(toggle_hidden); 226 m_hide_timer.setCommand(toggle_hidden);
225 m_hide_timer.fireOnce(true); 227 m_hide_timer.fireOnce(true);
@@ -326,6 +328,10 @@ void Toolbar::screenChanged(BScreen &screen) {
326 reconfigure(); 328 reconfigure();
327} 329}
328 330
331void Toolbar::autoRaiseDelayChanged(time_t delay) {
332 m_hide_timer.setTimeout(delay * FbTk::FbTime::IN_MILLISECONDS);
333}
334
329void Toolbar::reconfigure() { 335void Toolbar::reconfigure() {
330 336
331 updateVisibleState(); 337 updateVisibleState();
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index b0aeb60..924241b 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -144,6 +144,7 @@ private:
144 144
145 /// Called when the screen changed property. 145 /// Called when the screen changed property.
146 void screenChanged(BScreen &screen); 146 void screenChanged(BScreen &screen);
147 void autoRaiseDelayChanged(time_t delay);
147 148
148 bool m_hidden; ///< hidden state 149 bool m_hidden; ///< hidden state
149 150
diff --git a/src/Window.cc b/src/Window.cc
index 62822ab..2ceb3d9 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -431,7 +431,9 @@ void FluxboxWindow::init() {
431 431
432 updateMWMHintsFromClient(*m_client); 432 updateMWMHintsFromClient(*m_client);
433 433
434 m_timer.setTimeout(fluxbox.getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); 434 autoRaiseDelayChanged(*fluxbox.getAutoRaiseDelayResource());
435 join(fluxbox.getAutoRaiseDelayResource().modifiedSig(), FbTk::MemFun(*this,
436 &FluxboxWindow::autoRaiseDelayChanged ) );
435 FbTk::RefCount<FbTk::Command<void> > raise_cmd(new FbTk::SimpleCommand<FluxboxWindow>(*this, 437 FbTk::RefCount<FbTk::Command<void> > raise_cmd(new FbTk::SimpleCommand<FluxboxWindow>(*this,
436 &FluxboxWindow::raise)); 438 &FluxboxWindow::raise));
437 m_timer.setCommand(raise_cmd); 439 m_timer.setCommand(raise_cmd);
@@ -1064,7 +1066,6 @@ void FluxboxWindow::reconfigure() {
1064 applyDecorations(); 1066 applyDecorations();
1065 setFocusFlag(m_focused); 1067 setFocusFlag(m_focused);
1066 moveResize(frame().x(), frame().y(), frame().width(), frame().height()); 1068 moveResize(frame().x(), frame().y(), frame().width(), frame().height());
1067 m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS);
1068 updateButtons(); 1069 updateButtons();
1069 frame().reconfigure(); 1070 frame().reconfigure();
1070 menu().reconfigure(); 1071 menu().reconfigure();
@@ -2650,6 +2651,10 @@ void FluxboxWindow::frameExtentChanged() {
2650 } 2651 }
2651} 2652}
2652 2653
2654void FluxboxWindow::autoRaiseDelayChanged(time_t delay) {
2655 m_timer.setTimeout(delay * FbTk::FbTime::IN_MILLISECONDS);
2656}
2657
2653void FluxboxWindow::themeReconfigured() { 2658void FluxboxWindow::themeReconfigured() {
2654 frame().applyDecorations(); 2659 frame().applyDecorations();
2655 sendConfigureNotify(); 2660 sendConfigureNotify();
diff --git a/src/Window.hh b/src/Window.hh
index b7975f5..bdcf4cd 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -523,7 +523,7 @@ private:
523 /// Called when workspace area on screen changed. 523 /// Called when workspace area on screen changed.
524 void workspaceAreaChanged(BScreen &screen); 524 void workspaceAreaChanged(BScreen &screen);
525 void frameExtentChanged(); 525 void frameExtentChanged();
526 526 void autoRaiseDelayChanged(time_t delay);
527 527
528 // state and hint signals 528 // state and hint signals
529 FbTk::Signal<FluxboxWindow &> m_workspacesig, m_statesig, m_layersig, m_hintsig; 529 FbTk::Signal<FluxboxWindow &> m_workspacesig, m_statesig, m_layersig, m_hintsig;
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 3e2e756..5564d7f 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -127,7 +127,8 @@ public:
127 FbTk::IntResource &getTabsPaddingResource() { return m_rc_tabs_padding; } 127 FbTk::IntResource &getTabsPaddingResource() { return m_rc_tabs_padding; }
128 128
129 129
130 time_t getAutoRaiseDelay() const { return *m_rc_auto_raise_delay; } 130 FbTk::Resource<time_t, FbTk::IntTraits<time_t> > &
131 getAutoRaiseDelayResource() { return m_rc_auto_raise_delay; }
131 132
132 FbTk::UIntResource &getCacheLifeResource() { return m_rc_cache_life; } 133 FbTk::UIntResource &getCacheLifeResource() { return m_rc_cache_life; }
133 FbTk::UIntResource &getCacheMaxResource() { return m_rc_cache_max; } 134 FbTk::UIntResource &getCacheMaxResource() { return m_rc_cache_max; }