diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Rahm/Desktop/Layout.hs | 4 | ||||
| -rw-r--r-- | src/Rahm/Desktop/Layout/Hole.hs | 25 | ||||
| -rw-r--r-- | src/Rahm/Desktop/StackSet.hs | 8 |
3 files changed, 23 insertions, 14 deletions
diff --git a/src/Rahm/Desktop/Layout.hs b/src/Rahm/Desktop/Layout.hs index f4c9d8d..d71989f 100644 --- a/src/Rahm/Desktop/Layout.hs +++ b/src/Rahm/Desktop/Layout.hs @@ -40,8 +40,8 @@ import XMonad.Layout.Spacing (Border (..), spacingRaw) import XMonad.Layout.Spiral (spiral) myLayout = - hole $ - fullscreenFull $ + fullscreenFull $ + hole $ avoidStruts myLayoutList mySpacing = spacingRaw True (Border 5 5 5 5) True (Border 5 5 5 5) True diff --git a/src/Rahm/Desktop/Layout/Hole.hs b/src/Rahm/Desktop/Layout/Hole.hs index d00cc29..8bebb36 100644 --- a/src/Rahm/Desktop/Layout/Hole.hs +++ b/src/Rahm/Desktop/Layout/Hole.hs @@ -89,18 +89,19 @@ instance (LayoutClass l a, a ~ Window) => LayoutClass (Hole l) a where | Just positions <- sortIt <$> Map.lookup t mp = let integrated = W.integrate s in W.Workspace t l $ - W.differentiate $ - addr integrated $ - foldl - ( \((idx, pos, fakeid), ret) w -> - case pos of - ((TilePosition _ n, win) : tpos) - | n == idx && win `notElem` integrated -> - ((idx + 1, tpos, fakeid - 1), w : fakeid : ret) - _ -> ((idx + 1, pos, fakeid), w : ret) - ) - ((0, positions, -1), []) - integrated + W.differentiateWithFocus (W.focus s) $ + reverse $ + addr integrated $ + foldl + ( \((idx, pos, fakeid), ret) w -> + case pos of + ((TilePosition _ n, win) : tpos) + | n == idx && win `notElem` integrated -> + ((idx + 1, tpos, fakeid - 1), w : fakeid : ret) + _ -> ((idx + 1, pos, fakeid), w : ret) + ) + ((0, positions, -1), []) + integrated app _ w = w sortIt = sortOn (\(TilePosition _ p, _) -> p) diff --git a/src/Rahm/Desktop/StackSet.hs b/src/Rahm/Desktop/StackSet.hs index 7793ec5..2dc8787 100644 --- a/src/Rahm/Desktop/StackSet.hs +++ b/src/Rahm/Desktop/StackSet.hs @@ -1,6 +1,7 @@ module Rahm.Desktop.StackSet ( masterWindow, allVisibleWindows, + differentiateWithFocus, concatMapTiledWindows, windowsOnWorkspace, findWorkspace, @@ -262,6 +263,13 @@ modifyWorkspace tag fn = else ws ) +differentiateWithFocus :: (Eq a) => a -> [a] -> Maybe (Stack a) +differentiateWithFocus _ [] = Nothing +differentiateWithFocus thing lst = + case break (==thing) lst of + (up, foc:down) -> Just $ Stack foc (reverse up) down + _ -> differentiate lst + getFocusedWindow :: StackSet i l a s sd -> Maybe a getFocusedWindow (StackSet cur _ _ _) = W.focus <$> (W.stack . W.workspace) cur |