summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-08-26 21:27:23 +0000
committerDana Jansens <danakj@orodu.net>2002-08-26 21:27:23 +0000
commitda8d6b3f60a3eb39ca47cfcb9aa5b2f445050102 (patch)
tree8cdaed74ee3e6237ba1429f20ed7ed3678afe02c
parentafbc5546849cf1c0fb44fe0ac6c42986cdfeca4b (diff)
dont break the focused window iterator
-rw-r--r--util/epist/screen.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/util/epist/screen.cc b/util/epist/screen.cc
index 982c2173..416bb9bd 100644
--- a/util/epist/screen.cc
+++ b/util/epist/screen.cc
@@ -541,16 +541,18 @@ void screen::updateActiveWindow() {
_active = it;
- /* if we're not cycling and a window gets focus, add it to the top of the
- * cycle stack.
- */
- if (_stacked_cycling && !_cycling) {
- _clients.remove(*_active);
- _clients.push_front(*_active);
- }
+ if (_active != end) {
+ /* if we're not cycling and a window gets focus, add it to the top of the
+ * cycle stack.
+ */
+ if (_stacked_cycling && !_cycling) {
+ _clients.remove(*_active);
+ _clients.push_front(*_active);
+ _active = _clients.begin();
+ }
- if (it != end)
- _last_active = it;
+ _last_active = _active;
+ }
/* cout << "Active window is now: ";
if (_active == _clients.end()) cout << "None\n";