diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-06-28 08:03:33 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-06-28 08:03:33 +0200 |
commit | 8e6859cf299551667c9ea2c963a5d269424cd412 (patch) | |
tree | e47afb3cdcf3988b5136df0c4508b10672ffe382 /XMonad | |
parent | 58d0321e3e5b45205251b61c59a9a535bd3933f7 (diff) | |
download | XMonadContrib-8e6859cf299551667c9ea2c963a5d269424cd412.tar.gz XMonadContrib-8e6859cf299551667c9ea2c963a5d269424cd412.tar.xz XMonadContrib-8e6859cf299551667c9ea2c963a5d269424cd412.zip |
Run sublayouts in L.Sublayouts in a restricted state
Ignore-this: f2a236d3dc0374bbc1c19b864baa7c86
darcs-hash:20090628060333-1499c-37d5cb79a6c2bebf7948cc88e9164d011f428a5d.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Layout/SubLayouts.hs | 14 |
1 files changed, 11 insertions, 3 deletions
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 |