aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-05-21 03:48:58 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-21 03:48:58 (GMT)
commitc7ddf2e4e566a1587c9276a0f71f71d2a72ff014 (patch)
tree1151c27466783ea3233474bbba3a79f8116ab069 /src
parent079b1b13a039fd841ab2be0bbe0da486b15536a4 (diff)
downloadfluxbox_paul-c7ddf2e4e566a1587c9276a0f71f71d2a72ff014.zip
fluxbox_paul-c7ddf2e4e566a1587c9276a0f71f71d2a72ff014.tar.bz2
fix negative arguments to :GoToWindow
Diffstat (limited to 'src')
-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 }