diff options
| author | Josh Rahm <rahm@google.com> | 2023-12-05 18:06:33 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2023-12-05 18:06:33 -0700 |
| commit | 8d67f1ea8c614f12ddfc77d5727fb7fd8472484b (patch) | |
| tree | d048a9d74954c616340162198d51dea36d5b942c /src/Rahm/Desktop/StackSet.hs | |
| parent | 122b51770305f3f22050ba7000d168e298eb1661 (diff) | |
| download | rde-8d67f1ea8c614f12ddfc77d5727fb7fd8472484b.tar.gz rde-8d67f1ea8c614f12ddfc77d5727fb7fd8472484b.tar.bz2 rde-8d67f1ea8c614f12ddfc77d5727fb7fd8472484b.zip | |
Fixed problem with the hole layout where it was not passing on the focused window correctly
Diffstat (limited to 'src/Rahm/Desktop/StackSet.hs')
| -rw-r--r-- | src/Rahm/Desktop/StackSet.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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 |