aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-05-21 01:55:32 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-05-21 01:55:32 (GMT)
commit079b1b13a039fd841ab2be0bbe0da486b15536a4 (patch)
tree209c5d9809517514dc88e5477ba9f52b3ade461a /src/FocusControl.cc
parent855ff278aff6c0903eb6177c017d9936d2dd82ee (diff)
downloadfluxbox-079b1b13a039fd841ab2be0bbe0da486b15536a4.zip
fluxbox-079b1b13a039fd841ab2be0bbe0da486b15536a4.tar.bz2
if argument to :GoToWindow is too large, select the last window
Diffstat (limited to 'src/FocusControl.cc')
-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) {