aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-01-04 00:11:22 (GMT)
committermarkt <markt>2007-01-04 00:11:22 (GMT)
commit1dc07de3188c8c78f69e273694b27fa580423b55 (patch)
tree264f44a0d3a0d49f114eedfac890ec180b270d55 /src
parente2e94031f962513c746857349e8511b296d25986 (diff)
downloadfluxbox-1dc07de3188c8c78f69e273694b27fa580423b55.zip
fluxbox-1dc07de3188c8c78f69e273694b27fa580423b55.tar.bz2
move iconified windows to the end of the focused list for cycling/reverting
Diffstat (limited to 'src')
-rw-r--r--src/FocusControl.cc24
-rw-r--r--src/FocusControl.hh1
-rw-r--r--src/Window.cc2
3 files changed, 27 insertions, 0 deletions
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) {
151 m_creation_order_list.push_back(&client); 151 m_creation_order_list.push_back(&client);
152} 152}
153 153
154// move all clients in given window to back of focused list
155void FocusControl::setFocusBack(FluxboxWindow *fbwin) {
156 // do nothing if there are no windows open
157 if (m_focused_list.empty())
158 return;
159
160 FocusedWindows::iterator it = m_focused_list.begin();
161 // use back to avoid an infinite loop
162 FocusedWindows::iterator it_back = --m_focused_list.end();
163
164 while (it != it_back) {
165 if ((*it)->fbwindow() == fbwin) {
166 m_focused_list.push_back(*it);
167 it = m_focused_list.erase(it);
168 } else
169 ++it;
170 }
171 // move the last one, if necessary, in order to preserve focus order
172 if ((*it)->fbwindow() == fbwin) {
173 m_focused_list.push_back(*it);
174 m_focused_list.erase(it);
175 }
176}
177
154void FocusControl::stopCyclingFocus() { 178void FocusControl::stopCyclingFocus() {
155 // nothing to do 179 // nothing to do
156 if (!m_cycling_focus) 180 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:
85 bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; } 85 bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
86 bool isCycling() const { return m_cycling_focus; } 86 bool isCycling() const { return m_cycling_focus; }
87 void addFocusBack(WinClient &client); 87 void addFocusBack(WinClient &client);
88 void setFocusBack(FluxboxWindow *fbwin);
88 89
89 FocusModel focusModel() const { return *m_focus_model; } 90 FocusModel focusModel() const { return *m_focus_model; }
90 TabFocusModel tabFocusModel() const { return *m_tab_focus_model; } 91 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() {
1558 1558
1559 hide(true); 1559 hide(true);
1560 1560
1561 screen().focusControl().setFocusBack(this);
1562
1561 ClientList::iterator client_it = m_clientlist.begin(); 1563 ClientList::iterator client_it = m_clientlist.begin();
1562 const ClientList::iterator client_it_end = m_clientlist.end(); 1564 const ClientList::iterator client_it_end = m_clientlist.end();
1563 for (; client_it != client_it_end; ++client_it) { 1565 for (; client_it != client_it_end; ++client_it) {