aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Windows.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Internal/Windows.hs')
-rw-r--r--src/Internal/Windows.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Internal/Windows.hs b/src/Internal/Windows.hs
index b6f5335..c6a2b8b 100644
--- a/src/Internal/Windows.hs
+++ b/src/Internal/Windows.hs
@@ -1,7 +1,9 @@
module Internal.Windows where
+import XMonad (windowset, X, Window, get)
+
import Control.Applicative ((<|>))
-import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), integrate, integrate')
+import XMonad.StackSet (Stack(..), StackSet(..), Screen(..), Workspace(..), integrate, integrate', allWindows)
import Data.Maybe (listToMaybe, catMaybes)
import qualified Data.Map as Map
@@ -45,6 +47,11 @@ getLocationWorkspace _ = Nothing
workspaceMember :: (Eq a) => Workspace i l a -> a -> Bool
workspaceMember (Workspace _ _ s) w = w `elem` integrate' s
+forAllWindows :: (Window -> X ()) -> X ()
+forAllWindows fn = do
+ stackSet <- windowset <$> get
+ mapM_ fn (allWindows stackSet)
+
{- Finds a Window and returns the screen its on and the workspace its on.
- Returns nothing if the window doesn't exist.
-