diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2008-08-14 05:52:39 (GMT) |
commit | e169d33552c8e7070aa6e13da0187f2013b4cfc3 (patch) | |
tree | ae9e92c7e885791c7f47645184070cbcd441ab94 /src/FocusControl.cc | |
parent | c82e7c0080f8a5c14dcf95ec92dc42f59ea9dd8b (diff) | |
parent | 91ca3bc5c8e2b892a9a81b18246f72aba7deebfd (diff) | |
download | fluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.zip fluxbox-e169d33552c8e7070aa6e13da0187f2013b4cfc3.tar.bz2 |
Merge branch 'master' into to_push
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r-- | src/FocusControl.cc | 24 |
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 | ||
169 | void FocusControl::goToWindowNumber(const FocusableList &winlist, int num, | 169 | void 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 | ||
185 | void FocusControl::addFocusBack(WinClient &client) { | 191 | void FocusControl::addFocusBack(WinClient &client) { |