diff options
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r-- | src/FocusControl.cc | 24 |
1 files changed, 24 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 | ||
155 | void 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 | |||
154 | void FocusControl::stopCyclingFocus() { | 178 | void FocusControl::stopCyclingFocus() { |
155 | // nothing to do | 179 | // nothing to do |
156 | if (!m_cycling_focus) | 180 | if (!m_cycling_focus) |