From b7aaefbace2867206bd77f19660f7ae6c628fdb5 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Fri, 21 Sep 2007 22:43:16 +0200 Subject: make layouts preserved over restart darcs-hash:20070921204316-72aca-6f8cabc516cc87345bfa73be0e060b206aa2a207.gz --- XMonad.hs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index cec0574..f288469 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -131,10 +131,9 @@ atom_WM_STATE = getAtom "WM_STATE" -- returns an updated 'Layout' and the screen is refreshed. -- data SomeLayout a = forall l. Layout l a => SomeLayout (l a) + instance Show (SomeLayout a) where show (SomeLayout l) = show l -instance Read (SomeLayout a) where - readsPrec _ _ = [] -- We can't read an existential type!!! readLayout :: [SomeLayout a] -> String -> [(SomeLayout a, String)] readLayout ls s = concatMap rl ls @@ -146,10 +145,6 @@ class (Show (layout a), Read (layout a)) => Layout layout a where doLayout :: layout a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (layout a)) modifyLayout :: layout a -> SomeMessage -> X (Maybe (layout a)) -instance Layout SomeLayout a where - doLayout (SomeLayout l) r s = fmap (fmap $ fmap SomeLayout) $ doLayout l r s - modifyLayout (SomeLayout l) = fmap (fmap SomeLayout) . modifyLayout l - runLayout :: Layout l a => l a -> Rectangle -> StackOrNot a -> X ([(a, Rectangle)], Maybe (l a)) runLayout l r = maybe (return ([], Nothing)) (doLayout l r) -- cgit v1.2.3