all repos — fluxbox @ 1dc07de3188c8c78f69e273694b27fa580423b55

custom fork of the fluxbox windowmanager

move iconified windows to the end of the focused list for cycling/reverting
markt markt
commit

1dc07de3188c8c78f69e273694b27fa580423b55

parent

e2e94031f962513c746857349e8511b296d25986

4 files changed, 30 insertions(+), 0 deletions(-)

jump to
M ChangeLogChangeLog

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

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/04: + * Move minimized windows to the back of the focused list (Mark) + Window.cc FocusControl.cc/hh *07/01/03: * Don't run [startup] items in apps file on fluxbox restart (Mark) Remember.cc fluxbox.cc
M src/FocusControl.ccsrc/FocusControl.cc

@@ -151,6 +151,30 @@ m_focused_list.push_back(&client);

m_creation_order_list.push_back(&client); } +// move all clients in given window to back of focused list +void FocusControl::setFocusBack(FluxboxWindow *fbwin) { + // do nothing if there are no windows open + if (m_focused_list.empty()) + return; + + FocusedWindows::iterator it = m_focused_list.begin(); + // use back to avoid an infinite loop + FocusedWindows::iterator it_back = --m_focused_list.end(); + + while (it != it_back) { + if ((*it)->fbwindow() == fbwin) { + m_focused_list.push_back(*it); + it = m_focused_list.erase(it); + } else + ++it; + } + // move the last one, if necessary, in order to preserve focus order + if ((*it)->fbwindow() == fbwin) { + m_focused_list.push_back(*it); + m_focused_list.erase(it); + } +} + void FocusControl::stopCyclingFocus() { // nothing to do if (!m_cycling_focus)
M src/FocusControl.hhsrc/FocusControl.hh

@@ -85,6 +85,7 @@ bool isMouseFocus() const { return focusModel() == MOUSEFOCUS; }

bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; } bool isCycling() const { return m_cycling_focus; } void addFocusBack(WinClient &client); + void setFocusBack(FluxboxWindow *fbwin); FocusModel focusModel() const { return *m_focus_model; } TabFocusModel tabFocusModel() const { return *m_tab_focus_model; }
M src/Window.ccsrc/Window.cc

@@ -1558,6 +1558,8 @@ setState(IconicState, false);

hide(true); + screen().focusControl().setFocusBack(this); + ClientList::iterator client_it = m_clientlist.begin(); const ClientList::iterator client_it_end = m_clientlist.end(); for (; client_it != client_it_end; ++client_it) {