From 1dc07de3188c8c78f69e273694b27fa580423b55 Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 4 Jan 2007 00:11:22 +0000 Subject: move iconified windows to the end of the focused list for cycling/reverting --- ChangeLog | 3 +++ src/FocusControl.cc | 24 ++++++++++++++++++++++++ src/FocusControl.hh | 1 + src/Window.cc | 2 ++ 4 files changed, 30 insertions(+) diff --git a/ChangeLog b/ChangeLog index 93847ec..ae88888 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/FocusControl.cc b/src/FocusControl.cc index d3e6838..d09738d 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -151,6 +151,30 @@ void FocusControl::addFocusBack(WinClient &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) diff --git a/src/FocusControl.hh b/src/FocusControl.hh index 9b7c5b6..df7922b 100644 --- a/src/FocusControl.hh +++ b/src/FocusControl.hh @@ -85,6 +85,7 @@ public: 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; } diff --git a/src/Window.cc b/src/Window.cc index b341937..53ec88d 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1558,6 +1558,8 @@ void FluxboxWindow::iconify() { 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) { -- cgit v0.11.2