mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 20:51:52 -07:00
X.L.MagicFocus: always use focused as master
Instead of searching for the currently focused window across workspaces, make it so there is never any window above focus on the Stack that is given to the modified layout. Closes #657.
This commit is contained in:
@@ -37,6 +37,12 @@
|
|||||||
- Fixed navigation getting "stuck" in certain situations for
|
- Fixed navigation getting "stuck" in certain situations for
|
||||||
widescreen resolutions.
|
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)
|
## 0.17.0 (October 27, 2021)
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
@@ -57,14 +57,11 @@ magicFocus = ModifiedLayout MagicFocus
|
|||||||
data MagicFocus a = MagicFocus deriving (Show, Read)
|
data MagicFocus a = MagicFocus deriving (Show, Read)
|
||||||
|
|
||||||
instance LayoutModifier MagicFocus Window where
|
instance LayoutModifier MagicFocus Window where
|
||||||
modifyLayout MagicFocus (W.Workspace i l s) r =
|
modifyLayout MagicFocus (W.Workspace i l s) =
|
||||||
withWindowSet $ \wset ->
|
runLayout (W.Workspace i l (s >>= Just . shift))
|
||||||
runLayout (W.Workspace i l (s >>= \st -> Just $ swap st (W.peek wset))) r
|
|
||||||
|
|
||||||
swap :: (Eq a) => W.Stack a -> Maybe a -> W.Stack a
|
shift :: (Eq a) => W.Stack a -> W.Stack a
|
||||||
swap (W.Stack f u d) focused
|
shift (W.Stack f u d) = W.Stack f [] (reverse u ++ d)
|
||||||
| Just f == focused = W.Stack f [] (reverse u ++ d)
|
|
||||||
| otherwise = W.Stack f u d
|
|
||||||
|
|
||||||
-- | An eventHook that overrides the normal focusFollowsMouse. When the mouse
|
-- | An eventHook that overrides the normal focusFollowsMouse. When the mouse
|
||||||
-- it moved to another window, that window is replaced as the master, and the
|
-- it moved to another window, that window is replaced as the master, and the
|
||||||
|
Reference in New Issue
Block a user