From ccba298cb59e2d2dbd2235188e0695fff62c4799 Mon Sep 17 00:00:00 2001
From: Mark Tiefenbruck <mark@fluxbox.org>
Date: Mon, 18 Aug 2008 08:09:59 -0700
Subject: fix a bug with Some and Every commands and the stupid global current
 window variable

---
 src/WorkspaceCmd.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index ef7d992..7a8bbc4 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -125,8 +125,10 @@ bool SomeCmd::execute() {
             WinClient *client = dynamic_cast<WinClient *>(*it);
             if (!client) continue;
             WindowCmd<void>::setClient(client);
-            if (m_cmd->execute())
+            if (m_cmd->execute()) {
+                WindowCmd<void>::setClient(old);
                 return true;
+            }
         }
         WindowCmd<void>::setClient(old);
     }
@@ -146,8 +148,10 @@ bool EveryCmd::execute() {
             WinClient *client = dynamic_cast<WinClient *>(*it);
             if (!client) continue;
             WindowCmd<void>::setClient(client);
-            if (!m_cmd->execute())
+            if (!m_cmd->execute()) {
+                WindowCmd<void>::setClient(old);
                 return false;
+            }
         }
         WindowCmd<void>::setClient(old);
     }
-- 
cgit v0.11.2