From a75ad52be477adabc3ded5e3fbf5298d5eec9bc7 Mon Sep 17 00:00:00 2001 From: "quentin.moser" Date: Sun, 17 Jan 2010 12:47:08 +0100 Subject: Do not duplicate layouts in X.L.Groups Ignore-this: 100f8ccfbbcda9e8f5cc2b1470772928 I liked the idea, but it completey messes up Decoration layouts. darcs-hash:20100117114708-5ccef-459d59239b85786ac3d0a406be4c3f799c4a1089.gz --- XMonad/Layout/Groups.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'XMonad/Layout/Groups.hs') diff --git a/XMonad/Layout/Groups.hs b/XMonad/Layout/Groups.hs index 32603c1..75658d7 100644 --- a/XMonad/Layout/Groups.hs +++ b/XMonad/Layout/Groups.hs @@ -347,8 +347,8 @@ refocus g = case getFocusZ (groups g) >>= (getFocusZ . gZipper) -- -- * Remove windows (they will be added again) -- --- Duplicating a layout might cause problems with layouts that --- keep state in IORefs or such, but otherwise it's okay. +-- * Duplicate layouts (only one will be kept, the rest will +-- get the base layout) type ModifySpec = forall l. WithID l Window -> Zipper (Group l Window) -> Zipper (Group l Window) @@ -367,7 +367,7 @@ applySpec f g = let (seed', id:ids) = gen $ seed g in case elem myID seen of False -> ((id:ids, myID:seen), eg:egs) True -> ((ids, seen), mapE_ (setID id) eg:egs) - where setID id (G (ID _ l) z) = G (ID id l) z + where setID id (G (ID _ _) z) = G (ID id $ baseLayout g) z reID _ (([], _), _) = undefined -- The list of ids is infinite @@ -487,13 +487,13 @@ moveToGroupDown True _ gs = gs -- unless it's the last window - in that case, above it). splitGroup :: ModifySpec splitGroup _ Nothing = Nothing -splitGroup _ z@(Just s) | G l (Just ws) <- W.focus s +splitGroup l0 z@(Just s) | G l (Just ws) <- W.focus s = case ws of W.Stack _ [] [] -> z - W.Stack f (u:up) [] -> let g1 = G l $ Just $ W.Stack f [] [] - g2 = G l $ Just $ W.Stack u up [] + W.Stack f (u:up) [] -> let g1 = G l $ Just $ W.Stack f [] [] + g2 = G l0 $ Just $ W.Stack u up [] in insertDownZ g1 $ onFocusedZ (const g2) z - W.Stack f up (d:down) -> let g1 = G l $ Just $ W.Stack f up [] - g2 = G l $ Just $ W.Stack d [] down + W.Stack f up (d:down) -> let g1 = G l $ Just $ W.Stack f up [] + g2 = G l0 $ Just $ W.Stack d [] down in insertUpZ g1 $ onFocusedZ (const g2) z splitGroup _ _ = Nothing \ No newline at end of file -- cgit v1.2.3