Merge pull request #774 from slotThe/nsp/exclusive

X.U.NamedScratchpad: Add exclusive scratchpad capabilities
This commit is contained in:
Tony Zorman
2022-11-11 21:06:10 +01:00
committed by GitHub
6 changed files with 282 additions and 70 deletions

View File

@@ -134,11 +134,6 @@ focusTagged' :: (WindowSet -> [Window]) -> String -> X ()
focusTagged' wl t = gets windowset >>= findM (hasTag t) . wl >>=
maybe (return ()) (windows . focusWindow)
findM :: (Monad m) => (a -> m Bool) -> [a] -> m (Maybe a)
findM _ [] = return Nothing
findM p (x:xs) = do b <- p x
if b then return (Just x) else findM p xs
-- | apply a pure function to windows with a tag
withTaggedP, withTaggedGlobalP :: String -> (Window -> WindowSet -> WindowSet) -> X ()
withTaggedP t f = withTagged' t (winMap f)