diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-07-23 21:49:59 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-07-23 21:49:59 +0000 |
| commit | f6a3cd61f814c9a5190acb4af3b339dd4cd08647 (patch) | |
| tree | e4f22dcb54635ca7f6a3c09f310f7c5496fab8dc /util | |
| parent | 809f819e6f93a599e6312d5c4f226b339b9456f1 (diff) | |
cycle windows was looping forever!
Diffstat (limited to 'util')
| -rw-r--r-- | util/epist/screen.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 6b7b08a0..99de22b4 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -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; @@ -443,6 +441,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) { @@ -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) || |
