]> Dogcows Code - chaz/openbox/commitdiff
dont break the focused window iterator
authorDana Jansens <danakj@orodu.net>
Mon, 26 Aug 2002 21:27:23 +0000 (21:27 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 26 Aug 2002 21:27:23 +0000 (21:27 +0000)
util/epist/screen.cc

index 982c2173b54c01f6c5405196e912d077e9fa6a58..416bb9bdd1de097162447656aa2fdb4700e3bf17 100644 (file)
@@ -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";
This page took 0.026171 seconds and 4 git commands to generate.