ScreenLayouts.hs: updates to the last API changes

A silent API change broke this nice piece of David's code: Spencer decided
to move screen details into StackSet, and there we went to manipulate them!
This commit is contained in:
Andrea Rossato
2007-07-03 20:11:45 +00:00
parent 52e6f1c210
commit f412ea4a59

View File

@@ -18,7 +18,6 @@ module XMonadContrib.LayoutScreens (
layoutScreens
) where
import Control.Monad.State ( modify )
import Control.Monad.Reader ( asks )
import XMonad
@@ -49,13 +48,13 @@ layoutScreens nscr _ | nscr < 1 = trace $ "Can't layoutScreens with only " ++ sh
layoutScreens nscr l =
do rtrect <- asks theRoot >>= getWindowRectangle
(wss, _) <- doLayout l rtrect W.Stack { W.focus=1, W.up=[],W.down=[1..nscr-1] }
modify $ \s -> s { xineScreens = map snd wss
, statusGaps = take nscr $ (statusGaps s) ++ repeat (0,0,0,0) }
O.windows $ \ws@(W.StackSet { W.current = v, W.visible = vs, W.hidden = hs }) ->
let (x:xs, ys) = splitAt nscr $ map W.workspace (v:vs) ++ hs
in ws { W.current = W.Screen x 0
, W.visible = zipWith W.Screen xs [1 ..]
gaps = map (statusGap . W.screenDetail) $ v:vs
(s:ss, g:gg) = (map snd wss, take nscr $ gaps ++ repeat (0,0,0,0))
sd = zipWith SD ss gg
in ws { W.current = W.Screen x 0 (SD s g)
, W.visible = zipWith3 W.Screen xs [1 ..] sd
, W.hidden = ys }
getWindowRectangle :: Window -> X Rectangle