]> Dogcows Code - chaz/openbox/blobdiff - util/epist/screen.cc
cycle windows was looping forever!
[chaz/openbox] / util / epist / screen.cc
index 6b7b08a005b145de6b64a37b6e3eb918a319ff35..99de22b4c0ed7a7018bf90bc09da554064a51329 100644 (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;
@@ -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) ||
This page took 0.021571 seconds and 4 git commands to generate.