diff options
author | Max Rabkin <max.rabkin@gmail.com> | 2010-03-10 18:01:59 +0100 |
---|---|---|
committer | Max Rabkin <max.rabkin@gmail.com> | 2010-03-10 18:01:59 +0100 |
commit | 7a3035c299185d9af31601772c9607e8e1844027 (patch) | |
tree | 27238d6e9fe7ae213d5064fcd00e432d27098193 /XMonad | |
parent | dad63f81a9ac309f3c43cc79b7d8f07428c876e8 (diff) | |
download | XMonadContrib-7a3035c299185d9af31601772c9607e8e1844027.tar.gz XMonadContrib-7a3035c299185d9af31601772c9607e8e1844027.tar.xz XMonadContrib-7a3035c299185d9af31601772c9607e8e1844027.zip |
Fix bugs with nested drawers in X.L.Drawer
Ignore-this: 5c7665f3f3ea2c629deb0cca3715bb8d
There were two bugs:
1. The layout modifier assumed the rect's x was zero.
2. The layout modifier assumed that the stackset's focus actually had focus.
darcs-hash:20100310170159-a5338-19f7aa3df6ad57734d0ebc874e5d758935d19850.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad/Layout/Drawer.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/XMonad/Layout/Drawer.hs b/XMonad/Layout/Drawer.hs index 04e900e..909ecfb 100644 --- a/XMonad/Layout/Drawer.hs +++ b/XMonad/Layout/Drawer.hs @@ -73,16 +73,17 @@ instance (LayoutClass l Window, Read (l Window)) => LayoutModifier (Drawer l) Wi (upD, upM) <- partitionM (hasProperty p) up_ (downD, downM) <- partitionM (hasProperty p) down_ b <- hasProperty p w + focusedWindow <- gets (fmap S.focus . stack . workspace . current . windowset) - let (rectD, stackD, stackM) = if b - then ( rectB - , Just $ stk { up=upD, down=downD } - , mkStack upM downM ) - else ( rectS - , mkStack upD downD - , Just $ stk { up=upM, down=downM } ) + let rectD = if b && Just w == focusedWindow then rectB else rectS - (winsD, _) <- runLayout (ws { layout=l , stack=stackD }) rectD + let (stackD, stackM) = if b + then ( Just $ stk { up=upD, down=downD } + , mkStack upM downM ) + else ( mkStack upD downD + , Just $ stk { up=upM, down=downM } ) + + (winsD, _) <- runLayout (ws { layout=l, stack=stackD }) rectD (winsM, u') <- runLayout (ws { stack=stackM }) rectM return (winsD ++ winsM, u') where @@ -91,7 +92,7 @@ instance (LayoutClass l Window, Read (l Window)) => LayoutModifier (Drawer l) Wi mkStack (x:xs) ys = Just (Stack { up=xs, S.focus=x, down=ys }) rectB = rect { rect_width=round $ fromIntegral (rect_width rect) * rb } - rectS = rectB { rect_x=round $ (rs - rb) * fromIntegral (rect_width rect) } + rectS = rectB { rect_x=rect_x rectB - (round $ (rb - rs) * fromIntegral (rect_width rect)) } rectM = rect { rect_x=rect_x rect + round (fromIntegral (rect_width rect) * rs) , rect_width=rect_width rect - round (fromIntegral (rect_width rect) * rs) } |