diff --git a/CHANGES.md b/CHANGES.md index f342d142..01923083 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -37,6 +37,12 @@ - Fixed navigation getting "stuck" in certain situations for widescreen resolutions. + * `XMonad.Layout.MagicFocus` + + - The focused window will always be at the master area in the stack being + passed onto the modified layout, even when focus leaves the workspace + using the modified layout. + ## 0.17.0 (October 27, 2021) ### Breaking Changes diff --git a/XMonad/Layout/MagicFocus.hs b/XMonad/Layout/MagicFocus.hs index ba4e8cc0..70e7d77b 100644 --- a/XMonad/Layout/MagicFocus.hs +++ b/XMonad/Layout/MagicFocus.hs @@ -57,14 +57,11 @@ magicFocus = ModifiedLayout MagicFocus data MagicFocus a = MagicFocus deriving (Show, Read) instance LayoutModifier MagicFocus Window where - modifyLayout MagicFocus (W.Workspace i l s) r = - withWindowSet $ \wset -> - runLayout (W.Workspace i l (s >>= \st -> Just $ swap st (W.peek wset))) r + modifyLayout MagicFocus (W.Workspace i l s) = + runLayout (W.Workspace i l (s >>= Just . shift)) -swap :: (Eq a) => W.Stack a -> Maybe a -> W.Stack a -swap (W.Stack f u d) focused - | Just f == focused = W.Stack f [] (reverse u ++ d) - | otherwise = W.Stack f u d +shift :: (Eq a) => W.Stack a -> W.Stack a +shift (W.Stack f u d) = W.Stack f [] (reverse u ++ d) -- | An eventHook that overrides the normal focusFollowsMouse. When the mouse -- it moved to another window, that window is replaced as the master, and the