mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
fix MagicFocus/floats interaction
This commit is contained in:
parent
405a7c6307
commit
73c26465a6
@ -16,6 +16,7 @@ module XMonadContrib.MagicFocus (
|
|||||||
-- $usage
|
-- $usage
|
||||||
magicFocus) where
|
magicFocus) where
|
||||||
|
|
||||||
|
import Graphics.X11.Xlib (Window)
|
||||||
import XMonad
|
import XMonad
|
||||||
import StackSet
|
import StackSet
|
||||||
|
|
||||||
@ -23,9 +24,10 @@ import StackSet
|
|||||||
-- > import XMonadContrib.MagicFocus
|
-- > import XMonadContrib.MagicFocus
|
||||||
-- > defaultLayouts = [ magicFocus tiled , magicFocus $ mirror tiled ]
|
-- > defaultLayouts = [ magicFocus tiled , magicFocus $ mirror tiled ]
|
||||||
|
|
||||||
magicFocus :: Layout a -> Layout a
|
magicFocus :: Layout Window -> Layout Window
|
||||||
magicFocus l = l { doLayout = \s -> (doLayout l) s . swap
|
magicFocus l = l { doLayout = \r s -> withWindowSet (return . peek) >>= (doLayout l) r . swap s
|
||||||
, modifyLayout = \x -> fmap magicFocus `fmap` modifyLayout l x }
|
, modifyLayout = \x -> fmap magicFocus `fmap` modifyLayout l x }
|
||||||
|
|
||||||
swap :: Stack a -> Stack a
|
swap :: (Eq a) => Stack a -> Maybe a -> Stack a
|
||||||
swap (Stack f u d) = Stack f [] (reverse u ++ d)
|
swap (Stack f u d) focused | Just f == focused = Stack f [] (reverse u ++ d)
|
||||||
|
| otherwise = Stack f u d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user