diff options
author | Peter De Wachter <pdewacht@gmail.com> | 2007-08-16 20:52:17 +0200 |
---|---|---|
committer | Peter De Wachter <pdewacht@gmail.com> | 2007-08-16 20:52:17 +0200 |
commit | f3640580c31fa104e4c83e4fa3743a2935e604cb (patch) | |
tree | 92a1b85741b56b612a27c5b99c0b8b29a0f66f3d | |
parent | fb11020ff58fa90144874331b10a31ed29c95213 (diff) | |
download | XMonadContrib-f3640580c31fa104e4c83e4fa3743a2935e604cb.tar.gz XMonadContrib-f3640580c31fa104e4c83e4fa3743a2935e604cb.tar.xz XMonadContrib-f3640580c31fa104e4c83e4fa3743a2935e604cb.zip |
fix MagicFocus/floats interaction
darcs-hash:20070816185217-06a25-a60903af8e985409436b2b797ee66dd3fd0bed34.gz
-rw-r--r-- | MagicFocus.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MagicFocus.hs b/MagicFocus.hs index cfe48b7..2376cdd 100644 --- a/MagicFocus.hs +++ b/MagicFocus.hs @@ -16,6 +16,7 @@ module XMonadContrib.MagicFocus ( -- $usage magicFocus) where +import Graphics.X11.Xlib (Window) import XMonad import StackSet @@ -23,9 +24,10 @@ import StackSet -- > import XMonadContrib.MagicFocus -- > defaultLayouts = [ magicFocus tiled , magicFocus $ mirror tiled ] -magicFocus :: Layout a -> Layout a -magicFocus l = l { doLayout = \s -> (doLayout l) s . swap +magicFocus :: Layout Window -> Layout Window +magicFocus l = l { doLayout = \r s -> withWindowSet (return . peek) >>= (doLayout l) r . swap s , modifyLayout = \x -> fmap magicFocus `fmap` modifyLayout l x } -swap :: Stack a -> Stack a -swap (Stack f u d) = Stack f [] (reverse u ++ d) +swap :: (Eq a) => Stack a -> Maybe a -> Stack a +swap (Stack f u d) focused | Just f == focused = Stack f [] (reverse u ++ d) + | otherwise = Stack f u d |