From 8e6859cf299551667c9ea2c963a5d269424cd412 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sun, 28 Jun 2009 08:03:33 +0200 Subject: Run sublayouts in L.Sublayouts in a restricted state Ignore-this: f2a236d3dc0374bbc1c19b864baa7c86 darcs-hash:20090628060333-1499c-37d5cb79a6c2bebf7948cc88e9164d011f428a5d.gz --- XMonad/Layout/SubLayouts.hs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout/SubLayouts.hs') diff --git a/XMonad/Layout/SubLayouts.hs b/XMonad/Layout/SubLayouts.hs index e98a936..9c03ac5 100644 --- a/XMonad/Layout/SubLayouts.hs +++ b/XMonad/Layout/SubLayouts.hs @@ -79,8 +79,8 @@ import Data.Map(Map) -- still leaves borders sticking around -- -- Issue 288: "XMonad.Layout.ResizableTile" assumes that its environment --- contains only the windows it is running: should sublayouts be run in a --- restricted environment that is then merged back? +-- contains only the windows it is running: sublayouts are run in a restricted +-- environment, should it be merged back? -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -280,12 +280,20 @@ instance (Read (l Window), Show (l Window), LayoutClass l Window) => LayoutModif let newL :: LayoutClass l Window => Rectangle -> WorkspaceId -> (l Window,Bool) -> (Maybe (W.Stack Window)) -> X ([(Window, Rectangle)], l Window) newL rect n (ol, mess) sst = do + orgStack <- currentStack + -- this would be much cleaner with some kind of data-accessor + let chStack x = modify (\s -> s { windowset = (windowset s) + { W.current = (W.current $ windowset s) + { W.workspace = (W.workspace $ W.current $ windowset s) { W.stack = x }}}}) let handle l (y,_) | mess = fromMaybe l <$> handleMessage l y | otherwise = return l kms = filter ((`elem` M.keys gs') . snd) ms + chStack sst nl <- foldM handle ol $ filter ((`elem` W.integrate' sst) . snd) kms - fmap (fromMaybe nl) <$> runLayout (W.Workspace n nl sst) rect + result <- runLayout (W.Workspace n nl sst) rect + chStack orgStack -- FIXME: merge back reordering, deletions? + return $ fromMaybe nl `second` result (urls,ssts) = unzip [ (newL gr i l sst, sst) | l <- map (second $ const True) sls -- cgit v1.2.3