if argument to :GoToWindow is too large, select the last window

This commit is contained in:
Mark Tiefenbruck 2008-05-20 18:55:32 -07:00
parent 855ff278af
commit 079b1b13a0

View file

@ -168,18 +168,20 @@ void FocusControl::cycleFocus(const FocusableList &window_list,
void FocusControl::goToWindowNumber(const FocusableList &winlist, int num,
const ClientPattern *pat) {
Focusable *win = 0;
Focusables::const_iterator it = winlist.clientList().begin();
Focusables::const_iterator it_end = winlist.clientList().end();
for (; it != it_end && num; ++it) {
if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
num > 0 ? --num : ++num;
if (!num) {
(*it)->focus();
if ((*it)->fbwindow())
(*it)->fbwindow()->raise();
}
win = *it;
}
}
if (win) {
win->focus();
if (win->fbwindow())
win->fbwindow()->raise();
}
}
void FocusControl::addFocusBack(WinClient &client) {