aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FocusControl.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index d094a55..3f8aac5 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -168,12 +168,16 @@ void FocusControl::cycleFocus(const FocusableList &window_list,
168 168
169void FocusControl::goToWindowNumber(const FocusableList &winlist, int num, 169void FocusControl::goToWindowNumber(const FocusableList &winlist, int num,
170 const ClientPattern *pat) { 170 const ClientPattern *pat) {
171 Focusables list = winlist.clientList();
172 if (num < 0) {
173 list.reverse();
174 num = -num;
175 }
171 Focusable *win = 0; 176 Focusable *win = 0;
172 Focusables::const_iterator it = winlist.clientList().begin(); 177 Focusables::const_iterator it = list.begin(), it_end = list.end();
173 Focusables::const_iterator it_end = winlist.clientList().end(); 178 for (; num && it != it_end; ++it) {
174 for (; it != it_end && num; ++it) {
175 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { 179 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
176 num > 0 ? --num : ++num; 180 --num;
177 win = *it; 181 win = *it;
178 } 182 }
179 } 183 }