diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-05-21 01:55:32 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-05-21 01:55:32 (GMT) |
commit | 079b1b13a039fd841ab2be0bbe0da486b15536a4 (patch) | |
tree | 209c5d9809517514dc88e5477ba9f52b3ade461a /src | |
parent | 855ff278aff6c0903eb6177c017d9936d2dd82ee (diff) | |
download | fluxbox_paul-079b1b13a039fd841ab2be0bbe0da486b15536a4.zip fluxbox_paul-079b1b13a039fd841ab2be0bbe0da486b15536a4.tar.bz2 |
if argument to :GoToWindow is too large, select the last window
Diffstat (limited to 'src')
-rw-r--r-- | src/FocusControl.cc | 12 |
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 | ||
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 | 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 | ||
185 | void FocusControl::addFocusBack(WinClient &client) { | 187 | void FocusControl::addFocusBack(WinClient &client) { |