From 8d67f1ea8c614f12ddfc77d5727fb7fd8472484b Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 5 Dec 2023 18:06:33 -0700 Subject: Fixed problem with the hole layout where it was not passing on the focused window correctly --- src/Rahm/Desktop/StackSet.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Rahm/Desktop/StackSet.hs') 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 -- cgit