if argument to :GoToWindow is too large, select the last window
This commit is contained in:
parent
855ff278af
commit
079b1b13a0
1 changed files with 7 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue