aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FocusControl.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index c17b900..d094a55 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -168,18 +168,20 @@ 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 Focusable *win = 0;
171 Focusables::const_iterator it = winlist.clientList().begin(); 172 Focusables::const_iterator it = winlist.clientList().begin();
172 Focusables::const_iterator it_end = winlist.clientList().end(); 173 Focusables::const_iterator it_end = winlist.clientList().end();
173 for (; it != it_end && num; ++it) { 174 for (; it != it_end && num; ++it) {
174 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) { 175 if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
175 num > 0 ? --num : ++num; 176 num > 0 ? --num : ++num;
176 if (!num) { 177 win = *it;
177 (*it)->focus();
178 if ((*it)->fbwindow())
179 (*it)->fbwindow()->raise();
180 }
181 } 178 }
182 } 179 }
180 if (win) {
181 win->focus();
182 if (win->fbwindow())
183 win->fbwindow()->raise();
184 }
183} 185}
184 186
185void FocusControl::addFocusBack(WinClient &client) { 187void FocusControl::addFocusBack(WinClient &client) {