move iconified windows to the end of the focused list for cycling/reverting
markt markt
4 files changed,
30 insertions(+),
0 deletions(-)
M
src/FocusControl.cc
→
src/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.hh
→
src/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.cc
→
src/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) {