From f3640580c31fa104e4c83e4fa3743a2935e604cb Mon Sep 17 00:00:00 2001 From: Peter De Wachter Date: Thu, 16 Aug 2007 20:52:17 +0200 Subject: fix MagicFocus/floats interaction darcs-hash:20070816185217-06a25-a60903af8e985409436b2b797ee66dd3fd0bed34.gz --- MagicFocus.hs | 10 ++++++---- 1 file 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 -- cgit v1.2.3