mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Run sublayouts in L.Sublayouts in a restricted state
This commit is contained in:
parent
a0ae1e8bba
commit
1893d67d09
@ -79,8 +79,8 @@ import Data.Map(Map)
|
|||||||
-- still leaves borders sticking around
|
-- still leaves borders sticking around
|
||||||
--
|
--
|
||||||
-- Issue 288: "XMonad.Layout.ResizableTile" assumes that its environment
|
-- Issue 288: "XMonad.Layout.ResizableTile" assumes that its environment
|
||||||
-- contains only the windows it is running: should sublayouts be run in a
|
-- contains only the windows it is running: sublayouts are run in a restricted
|
||||||
-- restricted environment that is then merged back?
|
-- environment, should it be merged back?
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
-- 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)
|
let newL :: LayoutClass l Window => Rectangle -> WorkspaceId -> (l Window,Bool)
|
||||||
-> (Maybe (W.Stack Window)) -> X ([(Window, Rectangle)], l Window)
|
-> (Maybe (W.Stack Window)) -> X ([(Window, Rectangle)], l Window)
|
||||||
newL rect n (ol, mess) sst = do
|
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,_)
|
let handle l (y,_)
|
||||||
| mess = fromMaybe l <$> handleMessage l y
|
| mess = fromMaybe l <$> handleMessage l y
|
||||||
| otherwise = return l
|
| otherwise = return l
|
||||||
kms = filter ((`elem` M.keys gs') . snd) ms
|
kms = filter ((`elem` M.keys gs') . snd) ms
|
||||||
|
chStack sst
|
||||||
nl <- foldM handle ol $ filter ((`elem` W.integrate' sst) . snd) kms
|
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)
|
(urls,ssts) = unzip [ (newL gr i l sst, sst)
|
||||||
| l <- map (second $ const True) sls
|
| l <- map (second $ const True) sls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user