mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-27 18:21:52 -07:00
Actions.GroupNavigation: add isOnAnyVisibleWS
This commit is contained in:
@@ -27,6 +27,7 @@ module XMonad.Actions.GroupNavigation ( -- * Usage
|
|||||||
, nextMatchOrDo
|
, nextMatchOrDo
|
||||||
, nextMatchWithThis
|
, nextMatchWithThis
|
||||||
, historyHook
|
, historyHook
|
||||||
|
, isOnAnyVisibleWS
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
@@ -216,3 +217,14 @@ findM cond xs = findM' cond (viewl xs)
|
|||||||
if isMatch
|
if isMatch
|
||||||
then return (Just x')
|
then return (Just x')
|
||||||
else findM qry xs'
|
else findM qry xs'
|
||||||
|
|
||||||
|
|
||||||
|
isOnAnyVisibleWS :: Query Bool
|
||||||
|
isOnAnyVisibleWS = do
|
||||||
|
w <- ask
|
||||||
|
ws <- liftX $ gets windowset
|
||||||
|
let allVisible = concat $ maybe [] W.integrate . W.stack . W.workspace <$> W.current ws:W.visible ws
|
||||||
|
visibleWs = w `elem` allVisible
|
||||||
|
unfocused = maybe True (w /=) $ W.peek ws
|
||||||
|
return $ visibleWs && unfocused
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user