From 658f4989822341af8b2f62fc6eb0355b55945b44 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Tue, 3 Jul 2007 22:11:45 +0200 Subject: 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! darcs-hash:20070703201145-32816-eee668ce9ca1fa2ce2cded88ac702dc3ec3c739b.gz --- LayoutScreens.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/LayoutScreens.hs b/LayoutScreens.hs index bda3034..18e6ec4 100644 --- a/LayoutScreens.hs +++ b/LayoutScreens.hs @@ -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 -- cgit v1.2.3