aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/Groups.hs
diff options
context:
space:
mode:
authorquentin.moser <quentin.moser@unifr.ch>2010-01-17 12:47:08 +0100
committerquentin.moser <quentin.moser@unifr.ch>2010-01-17 12:47:08 +0100
commita75ad52be477adabc3ded5e3fbf5298d5eec9bc7 (patch)
tree8e50a4458f7a84b1f444a56f760a6df1f8733c57 /XMonad/Layout/Groups.hs
parent0ec12a84fb9dfaf7a61be59d02613c2b7f288de3 (diff)
downloadXMonadContrib-a75ad52be477adabc3ded5e3fbf5298d5eec9bc7.tar.gz
XMonadContrib-a75ad52be477adabc3ded5e3fbf5298d5eec9bc7.tar.xz
XMonadContrib-a75ad52be477adabc3ded5e3fbf5298d5eec9bc7.zip
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
Diffstat (limited to 'XMonad/Layout/Groups.hs')
-rw-r--r--XMonad/Layout/Groups.hs16
1 files changed, 8 insertions, 8 deletions
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