all repos — fluxbox @ 079b1b13a039fd841ab2be0bbe0da486b15536a4

custom fork of the fluxbox windowmanager

if argument to :GoToWindow is too large, select the last window
Mark Tiefenbruck mark@fluxbox.org
commit

079b1b13a039fd841ab2be0bbe0da486b15536a4

parent

855ff278aff6c0903eb6177c017d9936d2dd82ee

1 files changed, 7 insertions(+), 5 deletions(-)

jump to
M src/FocusControl.ccsrc/FocusControl.cc

@@ -168,17 +168,19 @@ }

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(); } }