all repos — fluxbox @ 16743aad06e7f8b6c2d3b0aab4311980ce06dc16

custom fork of the fluxbox windowmanager

don't change focus order unless the user specifically focuses a window
markt markt
commit

16743aad06e7f8b6c2d3b0aab4311980ce06dc16

parent

fa2519525aa8e08c4c11393a8734c606a7820ee1

5 files changed, 18 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/13: + * Only change focus order when user specifically focuses a window (Mark) + Screen.cc Window.cc FocusControl.cc/hh *07/01/11: * Added option to :Minimize key command to lower all windows in the same layer as the focused window -- syntax is `:Minimize (layer)' (Mark)
M src/FocusControl.ccsrc/FocusControl.cc

@@ -39,6 +39,7 @@ using std::string;

WinClient *FocusControl::s_focused_window = 0; FluxboxWindow *FocusControl::s_focused_fbwindow = 0; +bool FocusControl::s_reverting = false; FocusControl::FocusControl(BScreen &screen): m_screen(screen),

@@ -242,7 +243,7 @@ void FocusControl::setScreenFocusedWindow(WinClient &win_client) {

// raise newly focused window to the top of the focused list // don't change the order if we're cycling or shutting down - if (!m_cycling_focus && !win_client.screen().isShuttingdown()) { + if (!isCycling() && !m_screen.isShuttingdown() && !s_reverting) { m_focused_list.remove(&win_client); m_focused_list.push_front(&win_client); m_cycling_window = m_focused_list.begin();

@@ -396,6 +397,8 @@

if (screen.focusControl().isCycling()) return; + FocusControl::s_reverting = true; + WinClient *next_focus = screen.focusControl().lastFocusedWindow(screen.currentWorkspaceID());

@@ -412,6 +415,8 @@ screen.rootWindow().setInputFocus(RevertToPointerRoot, CurrentTime);

break; } } + + FocusControl::s_reverting = false; } /*
M src/FocusControl.hhsrc/FocusControl.hh

@@ -127,6 +127,7 @@ WinClient *m_cycling_last;

static WinClient *s_focused_window; static FluxboxWindow *s_focused_fbwindow; + static bool s_reverting; }; #endif // FOCUSCONTROL_HH
M src/Screen.ccsrc/Screen.cc

@@ -1129,7 +1129,7 @@ */

currentWorkspace()->showAll(); - if (focused && (focused->isStuck() || focused->isMoving())) + if (focused && focused->isMoving()) focused->setInputFocus(); else FocusControl::revertFocus(*this);
M src/Window.ccsrc/Window.cc

@@ -1053,7 +1053,8 @@ // make sure it's in our list

if (client.fbwindow() != this) return false; - m_screen.focusControl().setScreenFocusedWindow(client); + if (&client != m_client) + m_screen.focusControl().setScreenFocusedWindow(client); m_client = &client; m_client->raise(); m_client->focusSig().notify();

@@ -1432,6 +1433,11 @@ }

if (! m_client->validateClient()) return false; + + // this needs to be here rather than setFocusFlag because + // FocusControl::revertFocus will return before FocusIn events arrive + m_screen.focusControl().setScreenFocusedWindow(*m_client); + #ifdef DEBUG cerr<<"FluxboxWindow::"<<__FUNCTION__<<" isModal() = "<<m_client->isModal()<<endl; cerr<<"FluxboxWindow::"<<__FUNCTION__<<" transient size = "<<m_client->transients.size()<<endl;

@@ -2124,10 +2130,6 @@ focused = focus;

#ifdef DEBUG cerr<<"FluxboxWindow("<<title()<<")::setFocusFlag("<<focus<<")"<<endl; #endif // DEBUG - // Record focus timestamp for window cycling enhancements - if (focused) { - screen().focusControl().setScreenFocusedWindow(*m_client); - } installColormap(focus);