aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 0893d68..4aa896b 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -167,32 +167,17 @@ void FocusControl::cycleFocus(const Focusables &window_list,
167 167
168void FocusControl::goToWindowNumber(const Focusables &winlist, int num, 168void FocusControl::goToWindowNumber(const Focusables &winlist, int num,
169 const ClientPattern *pat) { 169 const ClientPattern *pat) {
170 Focusable *last_matched = 0; 170 Focusables::const_iterator it = winlist.begin();
171 if (num > 0) { 171 Focusables::const_iterator it_end = winlist.end();
172 Focusables::const_iterator it = winlist.begin(); 172 for (; it != it_end && num; ++it) {
173 Focusables::const_iterator it_end = winlist.end(); 173 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
174 for (; it != it_end; ++it) { 174 num > 0 ? --num : ++num;
175 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { 175 if (!num) {
176 --num; 176 (*it)->focus();
177 last_matched = *it; 177 if ((*it)->fbwindow())
178 if (!num) break; 178 (*it)->fbwindow()->raise();
179 } 179 }
180 } 180 }
181 } else if (num < 0) {
182 Focusables::const_reverse_iterator it = winlist.rbegin();
183 Focusables::const_reverse_iterator it_end = winlist.rend();
184 for (; it != it_end; ++it) {
185 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
186 ++num;
187 last_matched = *it;
188 if (!num) break;
189 }
190 }
191 }
192 if (last_matched) {
193 last_matched->focus();
194 if (last_matched->fbwindow())
195 last_matched->fbwindow()->raise();
196 } 181 }
197} 182}
198 183
@@ -371,7 +356,7 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
371 if ((*it) == &win 356 if ((*it) == &win
372 || (*it)->isIconic() 357 || (*it)->isIconic()
373 || (*it)->isFocusHidden() 358 || (*it)->isFocusHidden()
374 || !(*it)->winClient().acceptsFocus()) 359 || !(*it)->acceptsFocus())
375 continue; // skip self 360 continue; // skip self
376 361
377 // we check things against an edge, and within the bounds (draw a picture) 362 // we check things against an edge, and within the bounds (draw a picture)