aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-09-01 20:17:00 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-09-01 20:51:45 (GMT)
commit14e25f4a658f19389921fcfc6d7e355041146af1 (patch)
treec6efce52267736374b06b9232db565cbe9fe232c
parent3254816b6b0bbcf0e5b85ea8eb836ce9bac96bbb (diff)
downloadfluxbox-14e25f4a658f19389921fcfc6d7e355041146af1.zip
fluxbox-14e25f4a658f19389921fcfc6d7e355041146af1.tar.bz2
delay mouse driven tab focus by autoraise interval
REQUEST: 190
-rw-r--r--src/Window.cc10
-rw-r--r--src/Window.hh1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 77a228e..578736a 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -24,6 +24,7 @@
24 24
25#include "Window.hh" 25#include "Window.hh"
26 26
27#include "CurrentWindowCmd.hh"
27#include "WinClient.hh" 28#include "WinClient.hh"
28#include "fluxbox.hh" 29#include "fluxbox.hh"
29#include "Keys.hh" 30#include "Keys.hh"
@@ -360,6 +361,7 @@ FluxboxWindow::~FluxboxWindow() {
360 m_labelbuttons.clear(); 361 m_labelbuttons.clear();
361 362
362 m_timer.stop(); 363 m_timer.stop();
364 m_tabActivationTimer.stop();
363 365
364 // notify die 366 // notify die
365 dieSig().emit(*this); 367 dieSig().emit(*this);
@@ -441,6 +443,11 @@ void FluxboxWindow::init() {
441 m_timer.setCommand(raise_cmd); 443 m_timer.setCommand(raise_cmd);
442 m_timer.fireOnce(true); 444 m_timer.fireOnce(true);
443 445
446 m_tabActivationTimer.setTimeout(fluxbox.getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS);
447 FbTk::RefCount<ActivateTabCmd> activate_tab_cmd(new ActivateTabCmd());
448 m_tabActivationTimer.setCommand(activate_tab_cmd);
449 m_tabActivationTimer.fireOnce(true);
450
444 /**************************************************/ 451 /**************************************************/
445 /* Read state above here, apply state below here. */ 452 /* Read state above here, apply state below here. */
446 /**************************************************/ 453 /**************************************************/
@@ -1127,6 +1134,7 @@ void FluxboxWindow::reconfigure() {
1127 setFocusFlag(m_focused); 1134 setFocusFlag(m_focused);
1128 moveResize(frame().x(), frame().y(), frame().width(), frame().height()); 1135 moveResize(frame().x(), frame().y(), frame().width(), frame().height());
1129 m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); 1136 m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS);
1137 m_tabActivationTimer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS);
1130 updateButtons(); 1138 updateButtons();
1131 frame().reconfigure(); 1139 frame().reconfigure();
1132 menu().reconfigure(); 1140 menu().reconfigure();
@@ -2799,7 +2807,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2799 if (screen().focusControl().isMouseTabFocus() && 2807 if (screen().focusControl().isMouseTabFocus() &&
2800 client && client != m_client && 2808 client && client != m_client &&
2801 !screen().focusControl().isIgnored(ev.x_root, ev.y_root) ) { 2809 !screen().focusControl().isIgnored(ev.x_root, ev.y_root) ) {
2802 setCurrentClient(*client, isFocused()); 2810 m_tabActivationTimer.start();
2803 } 2811 }
2804 2812
2805} 2813}
diff --git a/src/Window.hh b/src/Window.hh
index 4235106..b6e56b2 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -552,6 +552,7 @@ private:
552 uint64_t m_creation_time; 552 uint64_t m_creation_time;
553 uint64_t m_last_keypress_time; 553 uint64_t m_last_keypress_time;
554 FbTk::Timer m_timer; 554 FbTk::Timer m_timer;
555 FbTk::Timer m_tabActivationTimer;
555 556
556 // Window states 557 // Window states
557 bool moving, resizing, m_initialized; 558 bool moving, resizing, m_initialized;