From 14e25f4a658f19389921fcfc6d7e355041146af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 1 Sep 2016 22:17:00 +0200 Subject: delay mouse driven tab focus by autoraise interval REQUEST: 190 --- src/Window.cc | 10 +++++++++- src/Window.hh | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) 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 @@ #include "Window.hh" +#include "CurrentWindowCmd.hh" #include "WinClient.hh" #include "fluxbox.hh" #include "Keys.hh" @@ -360,6 +361,7 @@ FluxboxWindow::~FluxboxWindow() { m_labelbuttons.clear(); m_timer.stop(); + m_tabActivationTimer.stop(); // notify die dieSig().emit(*this); @@ -441,6 +443,11 @@ void FluxboxWindow::init() { m_timer.setCommand(raise_cmd); m_timer.fireOnce(true); + m_tabActivationTimer.setTimeout(fluxbox.getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); + FbTk::RefCount activate_tab_cmd(new ActivateTabCmd()); + m_tabActivationTimer.setCommand(activate_tab_cmd); + m_tabActivationTimer.fireOnce(true); + /**************************************************/ /* Read state above here, apply state below here. */ /**************************************************/ @@ -1127,6 +1134,7 @@ void FluxboxWindow::reconfigure() { setFocusFlag(m_focused); moveResize(frame().x(), frame().y(), frame().width(), frame().height()); m_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); + m_tabActivationTimer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay() * FbTk::FbTime::IN_MILLISECONDS); updateButtons(); frame().reconfigure(); menu().reconfigure(); @@ -2799,7 +2807,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) { if (screen().focusControl().isMouseTabFocus() && client && client != m_client && !screen().focusControl().isIgnored(ev.x_root, ev.y_root) ) { - setCurrentClient(*client, isFocused()); + m_tabActivationTimer.start(); } } 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: uint64_t m_creation_time; uint64_t m_last_keypress_time; FbTk::Timer m_timer; + FbTk::Timer m_tabActivationTimer; // Window states bool moving, resizing, m_initialized; -- cgit v0.11.2