{-# LANGUAGE LambdaCase #-}
module XMonad.Layout.IndependentScreens (
VirtualWorkspace, PhysicalWorkspace,
VirtualWindowSpace, PhysicalWindowSpace,
workspaces',
withScreen, withScreens,
onCurrentScreen,
marshallPP,
whenCurrentOn,
countScreens,
workspacesOn,
workspaceOnScreen, focusWindow', focusScreen, nthWorkspace, withWspOnScreen,
marshall, unmarshall, unmarshallS, unmarshallW,
marshallWindowSpace, unmarshallWindowSpace, marshallSort,
) where
import Control.Arrow ((***))
import Graphics.X11.Xinerama
import XMonad
import XMonad.Hooks.StatusBar.PP
import XMonad.Prelude
import qualified XMonad.StackSet as W
type VirtualWorkspace = WorkspaceId
type PhysicalWorkspace = WorkspaceId
type PhysicalWindowSpace = WindowSpace
type VirtualWindowSpace = WindowSpace
marshall :: ScreenId -> VirtualWorkspace -> PhysicalWorkspace
marshall :: ScreenId -> VirtualWorkspace -> VirtualWorkspace
marshall (S Int
sc) VirtualWorkspace
vws = Int -> VirtualWorkspace
forall a. Show a => a -> VirtualWorkspace
show Int
sc VirtualWorkspace -> VirtualWorkspace -> VirtualWorkspace
forall a. [a] -> [a] -> [a]
++ Char
'_'Char -> VirtualWorkspace -> VirtualWorkspace
forall a. a -> [a] -> [a]
:VirtualWorkspace
vws
unmarshall :: PhysicalWorkspace -> (ScreenId, VirtualWorkspace)
unmarshallS :: PhysicalWorkspace -> ScreenId
unmarshallW :: PhysicalWorkspace -> VirtualWorkspace
unmarshall :: VirtualWorkspace -> (ScreenId, VirtualWorkspace)
unmarshall = ((Int -> ScreenId
S (Int -> ScreenId)
-> (VirtualWorkspace -> Int) -> VirtualWorkspace -> ScreenId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VirtualWorkspace -> Int
forall a. Read a => VirtualWorkspace -> a
read) (VirtualWorkspace -> ScreenId)
-> (VirtualWorkspace -> VirtualWorkspace)
-> (VirtualWorkspace, VirtualWorkspace)
-> (ScreenId, VirtualWorkspace)
forall (a :: * -> * -> *) b c b' c'.
Arrow a =>
a b c -> a b' c' -> a (b, b') (c, c')
*** Int -> VirtualWorkspace -> VirtualWorkspace
forall a. Int -> [a] -> [a]
drop Int
1) ((VirtualWorkspace, VirtualWorkspace)
-> (ScreenId, VirtualWorkspace))
-> (VirtualWorkspace -> (VirtualWorkspace, VirtualWorkspace))
-> VirtualWorkspace
-> (ScreenId, VirtualWorkspace)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Bool)
-> VirtualWorkspace -> (VirtualWorkspace, VirtualWorkspace)
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
==Char
'_')
unmarshallS :: VirtualWorkspace -> ScreenId
unmarshallS = (ScreenId, VirtualWorkspace) -> ScreenId
forall a b. (a, b) -> a
fst ((ScreenId, VirtualWorkspace) -> ScreenId)
-> (VirtualWorkspace -> (ScreenId, VirtualWorkspace))
-> VirtualWorkspace
-> ScreenId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VirtualWorkspace -> (ScreenId, VirtualWorkspace)
unmarshall
unmarshallW :: VirtualWorkspace -> VirtualWorkspace
unmarshallW = (ScreenId, VirtualWorkspace) -> VirtualWorkspace
forall a b. (a, b) -> b
snd ((ScreenId, VirtualWorkspace) -> VirtualWorkspace)
-> (VirtualWorkspace -> (ScreenId, VirtualWorkspace))
-> VirtualWorkspace
-> VirtualWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VirtualWorkspace -> (ScreenId, VirtualWorkspace)
unmarshall
workspaces' :: XConfig l -> [VirtualWorkspace]
workspaces' :: XConfig l -> [VirtualWorkspace]
workspaces' = [VirtualWorkspace] -> [VirtualWorkspace]
forall a. Eq a => [a] -> [a]
nub ([VirtualWorkspace] -> [VirtualWorkspace])
-> (XConfig l -> [VirtualWorkspace])
-> XConfig l
-> [VirtualWorkspace]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (VirtualWorkspace -> VirtualWorkspace)
-> [VirtualWorkspace] -> [VirtualWorkspace]
forall a b. (a -> b) -> [a] -> [b]
map VirtualWorkspace -> VirtualWorkspace
unmarshallW ([VirtualWorkspace] -> [VirtualWorkspace])
-> (XConfig l -> [VirtualWorkspace])
-> XConfig l
-> [VirtualWorkspace]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. XConfig l -> [VirtualWorkspace]
forall (l :: * -> *). XConfig l -> [VirtualWorkspace]
workspaces
withScreen :: ScreenId
-> [VirtualWorkspace]
-> [PhysicalWorkspace]
withScreen :: ScreenId -> [VirtualWorkspace] -> [VirtualWorkspace]
withScreen ScreenId
n = (VirtualWorkspace -> VirtualWorkspace)
-> [VirtualWorkspace] -> [VirtualWorkspace]
forall a b. (a -> b) -> [a] -> [b]
map (ScreenId -> VirtualWorkspace -> VirtualWorkspace
marshall ScreenId
n)
withScreens :: ScreenId
-> [VirtualWorkspace]
-> [PhysicalWorkspace]
withScreens :: ScreenId -> [VirtualWorkspace] -> [VirtualWorkspace]
withScreens ScreenId
n [VirtualWorkspace]
vws = (ScreenId -> [VirtualWorkspace])
-> [ScreenId] -> [VirtualWorkspace]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (ScreenId -> [VirtualWorkspace] -> [VirtualWorkspace]
`withScreen` [VirtualWorkspace]
vws) [ScreenId
0..ScreenId
nScreenId -> ScreenId -> ScreenId
forall a. Num a => a -> a -> a
-ScreenId
1]
onCurrentScreen :: (PhysicalWorkspace -> WindowSet -> a) -> (VirtualWorkspace -> WindowSet -> a)
onCurrentScreen :: (VirtualWorkspace -> WindowSet -> a)
-> VirtualWorkspace -> WindowSet -> a
onCurrentScreen VirtualWorkspace -> WindowSet -> a
f VirtualWorkspace
vws WindowSet
ws =
let currentScreenId :: ScreenId
currentScreenId = Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> ScreenId
forall i l a sid sd. Screen i l a sid sd -> sid
W.screen (Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> ScreenId)
-> Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> ScreenId
forall a b. (a -> b) -> a -> b
$ WindowSet
-> Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
W.current WindowSet
ws
in VirtualWorkspace -> WindowSet -> a
f (ScreenId -> VirtualWorkspace -> VirtualWorkspace
marshall ScreenId
currentScreenId VirtualWorkspace
vws) WindowSet
ws
workspaceOnScreen :: ScreenId -> WindowSet -> Maybe PhysicalWorkspace
workspaceOnScreen :: ScreenId -> WindowSet -> Maybe VirtualWorkspace
workspaceOnScreen ScreenId
screenId WindowSet
ws = Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall i l a. Workspace i l a -> i
W.tag (Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace)
-> (Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> Workspace VirtualWorkspace (Layout Window) Window)
-> Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> VirtualWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> Workspace VirtualWorkspace (Layout Window) Window
forall i l a sid sd. Screen i l a sid sd -> Workspace i l a
W.workspace (Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> VirtualWorkspace)
-> Maybe
(Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail)
-> Maybe VirtualWorkspace
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ScreenId
-> WindowSet
-> Maybe
(Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail)
screenOnMonitor ScreenId
screenId WindowSet
ws
withWspOnScreen :: ScreenId
-> (PhysicalWorkspace -> WindowSet -> WindowSet)
-> WindowSet -> WindowSet
withWspOnScreen :: ScreenId
-> (VirtualWorkspace -> WindowSet -> WindowSet)
-> WindowSet
-> WindowSet
withWspOnScreen ScreenId
screenId VirtualWorkspace -> WindowSet -> WindowSet
operation WindowSet
ws = case ScreenId -> WindowSet -> Maybe VirtualWorkspace
workspaceOnScreen ScreenId
screenId WindowSet
ws of
Just VirtualWorkspace
wsp -> VirtualWorkspace -> WindowSet -> WindowSet
operation VirtualWorkspace
wsp WindowSet
ws
Maybe VirtualWorkspace
Nothing -> WindowSet
ws
screenOnMonitor :: ScreenId -> WindowSet -> Maybe (W.Screen WorkspaceId (Layout Window) Window ScreenId ScreenDetail)
screenOnMonitor :: ScreenId
-> WindowSet
-> Maybe
(Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail)
screenOnMonitor ScreenId
screenId WindowSet
ws = (Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> Bool)
-> [Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail]
-> Maybe
(Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail)
forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Maybe a
find ((ScreenId
screenId ScreenId -> ScreenId -> Bool
forall a. Eq a => a -> a -> Bool
==) (ScreenId -> Bool)
-> (Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> ScreenId)
-> Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> ScreenId
forall i l a sid sd. Screen i l a sid sd -> sid
W.screen) (WindowSet
-> Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
forall i l a sid sd. StackSet i l a sid sd -> Screen i l a sid sd
W.current WindowSet
ws Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail
-> [Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail]
-> [Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail]
forall a. a -> [a] -> [a]
: WindowSet
-> [Screen
VirtualWorkspace (Layout Window) Window ScreenId ScreenDetail]
forall i l a sid sd. StackSet i l a sid sd -> [Screen i l a sid sd]
W.visible WindowSet
ws)
focusWindow' :: Window -> WindowSet -> WindowSet
focusWindow' :: Window -> WindowSet -> WindowSet
focusWindow' Window
window WindowSet
ws
| Window -> Maybe Window
forall a. a -> Maybe a
Just Window
window Maybe Window -> Maybe Window -> Bool
forall a. Eq a => a -> a -> Bool
== WindowSet -> Maybe Window
forall i l a s sd. StackSet i l a s sd -> Maybe a
W.peek WindowSet
ws = WindowSet
ws
| Bool
otherwise = case Window -> WindowSet -> Maybe VirtualWorkspace
forall a i l s sd. Eq a => a -> StackSet i l a s sd -> Maybe i
W.findTag Window
window WindowSet
ws of
Just VirtualWorkspace
tag -> Window -> WindowSet -> WindowSet
forall s a i l sd.
(Eq s, Eq a, Eq i) =>
a -> StackSet i l a s sd -> StackSet i l a s sd
W.focusWindow Window
window (WindowSet -> WindowSet) -> WindowSet -> WindowSet
forall a b. (a -> b) -> a -> b
$ ScreenId -> WindowSet -> WindowSet
focusScreen (VirtualWorkspace -> ScreenId
unmarshallS VirtualWorkspace
tag) WindowSet
ws
Maybe VirtualWorkspace
Nothing -> WindowSet
ws
focusScreen :: ScreenId -> WindowSet -> WindowSet
focusScreen :: ScreenId -> WindowSet -> WindowSet
focusScreen ScreenId
screenId = ScreenId
-> (VirtualWorkspace -> WindowSet -> WindowSet)
-> WindowSet
-> WindowSet
withWspOnScreen ScreenId
screenId VirtualWorkspace -> WindowSet -> WindowSet
forall s i l a sd.
(Eq s, Eq i) =>
i -> StackSet i l a s sd -> StackSet i l a s sd
W.view
nthWorkspace :: Int -> X (Maybe VirtualWorkspace)
nthWorkspace :: Int -> X (Maybe VirtualWorkspace)
nthWorkspace Int
n = ([VirtualWorkspace] -> Int -> Maybe VirtualWorkspace
forall a. [a] -> Int -> Maybe a
!? Int
n) ([VirtualWorkspace] -> Maybe VirtualWorkspace)
-> (XConfig Layout -> [VirtualWorkspace])
-> XConfig Layout
-> Maybe VirtualWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. XConfig Layout -> [VirtualWorkspace]
forall (l :: * -> *). XConfig l -> [VirtualWorkspace]
workspaces' (XConfig Layout -> Maybe VirtualWorkspace)
-> X (XConfig Layout) -> X (Maybe VirtualWorkspace)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (XConf -> XConfig Layout) -> X (XConfig Layout)
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks XConf -> XConfig Layout
config
countScreens :: (MonadIO m, Integral i) => m i
countScreens :: m i
countScreens = ([Rectangle] -> i) -> m [Rectangle] -> m i
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [Rectangle] -> i
forall i a. Num i => [a] -> i
genericLength (m [Rectangle] -> m i)
-> (IO [Rectangle] -> m [Rectangle]) -> IO [Rectangle] -> m i
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO [Rectangle] -> m [Rectangle]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Rectangle] -> m i) -> IO [Rectangle] -> m i
forall a b. (a -> b) -> a -> b
$ VirtualWorkspace -> IO Display
openDisplay VirtualWorkspace
"" IO Display -> (Display -> IO [Rectangle]) -> IO [Rectangle]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (IO [Rectangle] -> IO () -> IO [Rectangle])
-> (Display -> IO [Rectangle])
-> (Display -> IO ())
-> Display
-> IO [Rectangle]
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 IO [Rectangle] -> IO () -> IO [Rectangle]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
(<*) Display -> IO [Rectangle]
getScreenInfo Display -> IO ()
closeDisplay
marshallPP :: ScreenId -> PP -> PP
marshallPP :: ScreenId -> PP -> PP
marshallPP ScreenId
s PP
pp = PP
pp { ppRename :: VirtualWorkspace
-> Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
ppRename = PP
-> VirtualWorkspace
-> Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
ppRename PP
pp (VirtualWorkspace
-> Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace)
-> (VirtualWorkspace -> VirtualWorkspace)
-> VirtualWorkspace
-> Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VirtualWorkspace -> VirtualWorkspace
unmarshallW
, ppSort :: X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
ppSort = (([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScreenId
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
workspacesOn ScreenId
s) (([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> PP
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
ppSort PP
pp }
whenCurrentOn :: ScreenId -> PP -> PP
whenCurrentOn :: ScreenId -> PP -> PP
whenCurrentOn ScreenId
s PP
pp = PP
pp
{ ppSort :: X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
ppSort = do
[Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
sorter <- PP
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
ppSort PP
pp
([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
forall (f :: * -> *) a. Applicative f => a -> f a
pure (([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]))
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> X ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
forall a b. (a -> b) -> a -> b
$ \case xs :: [Workspace VirtualWorkspace (Layout Window) Window]
xs@(Workspace VirtualWorkspace (Layout Window) Window
x:[Workspace VirtualWorkspace (Layout Window) Window]
_) | VirtualWorkspace -> ScreenId
unmarshallS (Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall i l a. Workspace i l a -> i
W.tag Workspace VirtualWorkspace (Layout Window) Window
x) ScreenId -> ScreenId -> Bool
forall a. Eq a => a -> a -> Bool
== ScreenId
s -> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
sorter [Workspace VirtualWorkspace (Layout Window) Window]
xs
[Workspace VirtualWorkspace (Layout Window) Window]
_ -> []
, ppOrder :: [VirtualWorkspace] -> [VirtualWorkspace]
ppOrder = \case (VirtualWorkspace
"":[VirtualWorkspace]
_) -> [VirtualWorkspace
"\0"]
[VirtualWorkspace]
list -> PP -> [VirtualWorkspace] -> [VirtualWorkspace]
ppOrder PP
pp [VirtualWorkspace]
list
, ppOutput :: VirtualWorkspace -> IO ()
ppOutput = \case VirtualWorkspace
"\0" -> () -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
VirtualWorkspace
output -> PP -> VirtualWorkspace -> IO ()
ppOutput PP
pp VirtualWorkspace
output
}
workspacesOn :: ScreenId -> [PhysicalWindowSpace] -> [PhysicalWindowSpace]
workspacesOn :: ScreenId
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
workspacesOn ScreenId
s = (Workspace VirtualWorkspace (Layout Window) Window -> Bool)
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall a. (a -> Bool) -> [a] -> [a]
filter (\Workspace VirtualWorkspace (Layout Window) Window
ws -> VirtualWorkspace -> ScreenId
unmarshallS (Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall i l a. Workspace i l a -> i
W.tag Workspace VirtualWorkspace (Layout Window) Window
ws) ScreenId -> ScreenId -> Bool
forall a. Eq a => a -> a -> Bool
== ScreenId
s)
marshallSort :: ScreenId -> ([VirtualWindowSpace] -> [VirtualWindowSpace]) -> ([PhysicalWindowSpace] -> [PhysicalWindowSpace])
marshallSort :: ScreenId
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
marshallSort ScreenId
s [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
vSort = [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
pScreens ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
vSort ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
vScreens where
vScreens :: [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
vScreens = (Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window)
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall a b. (a -> b) -> [a] -> [b]
map Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window
unmarshallWindowSpace ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> ([Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window])
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScreenId
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
workspacesOn ScreenId
s
pScreens :: [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
pScreens = (Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window)
-> [Workspace VirtualWorkspace (Layout Window) Window]
-> [Workspace VirtualWorkspace (Layout Window) Window]
forall a b. (a -> b) -> [a] -> [b]
map (ScreenId
-> Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window
marshallWindowSpace ScreenId
s)
marshallWindowSpace :: ScreenId -> WindowSpace -> WindowSpace
unmarshallWindowSpace :: WindowSpace -> WindowSpace
marshallWindowSpace :: ScreenId
-> Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window
marshallWindowSpace ScreenId
s Workspace VirtualWorkspace (Layout Window) Window
ws = Workspace VirtualWorkspace (Layout Window) Window
ws { tag :: VirtualWorkspace
W.tag = ScreenId -> VirtualWorkspace -> VirtualWorkspace
marshall ScreenId
s (Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall i l a. Workspace i l a -> i
W.tag Workspace VirtualWorkspace (Layout Window) Window
ws) }
unmarshallWindowSpace :: Workspace VirtualWorkspace (Layout Window) Window
-> Workspace VirtualWorkspace (Layout Window) Window
unmarshallWindowSpace Workspace VirtualWorkspace (Layout Window) Window
ws = Workspace VirtualWorkspace (Layout Window) Window
ws { tag :: VirtualWorkspace
W.tag = VirtualWorkspace -> VirtualWorkspace
unmarshallW (Workspace VirtualWorkspace (Layout Window) Window
-> VirtualWorkspace
forall i l a. Workspace i l a -> i
W.tag Workspace VirtualWorkspace (Layout Window) Window
ws) }