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

This commit is contained in:
markt 2007-01-04 00:11:22 +00:00
parent e2e94031f9
commit 1dc07de318
4 changed files with 30 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

@ -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; }

View file

@ -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) {