summaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2008-08-14 05:52:39 (GMT)
commite169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch)
treeae9e92c7e885791c7f47645184070cbcd441ab94 /src/FocusControl.cc
parentc82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff)
parent91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff)
downloadfluxbox_lack-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip
fluxbox_lack-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2
Merge branch 'master' into to_push
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index c17b900..3f8aac5 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -168,18 +168,24 @@ 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::const_iterator it = winlist.clientList().begin(); 171 Focusables list = winlist.clientList();
172 Focusables::const_iterator it_end = winlist.clientList().end(); 172 if (num < 0) {
173 for (; it != it_end && num; ++it) { 173 list.reverse();
174 num = -num;
175 }
176 Focusable *win = 0;
177 Focusables::const_iterator it = list.begin(), it_end = list.end();
178 for (; num && it != it_end; ++it) {
174 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { 179 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
175 num > 0 ? --num : ++num; 180 --num;
176 if (!num) { 181 win = *it;
177 (*it)->focus();
178 if ((*it)->fbwindow())
179 (*it)->fbwindow()->raise();
180 }
181 } 182 }
182 } 183 }
184 if (win) {
185 win->focus();
186 if (win->fbwindow())
187 win->fbwindow()->raise();
188 }
183} 189}
184 190
185void FocusControl::addFocusBack(WinClient &client) { 191void FocusControl::addFocusBack(WinClient &client) {