cycle windows was looping forever!

This commit is contained in:
Dana Jansens 2002-07-23 21:49:59 +00:00
parent 809f819e6f
commit f6a3cd61f8

View file

@ -433,8 +433,6 @@ void screen::cycleWindow(const bool forward, const bool alldesktops,
const bool sameclass, const string &cn) const {
assert(_managed);
if (_clients.empty()) return;
WindowList::const_iterator target = _active;
string classname = cn;
@ -444,6 +442,8 @@ void screen::cycleWindow(const bool forward, const bool alldesktops,
if (target == _clients.end())
target = _clients.begin();
WindowList::const_iterator begin = target;
do {
if (forward) {
++target;
@ -454,6 +454,10 @@ void screen::cycleWindow(const bool forward, const bool alldesktops,
target = _clients.end();
--target;
}
// no window to focus
if (target == begin)
return;
} while (target == _clients.end() ||
(*target)->iconic() ||
(! alldesktops && (*target)->desktop() != _active_desktop) ||