aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/StackSet.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-12-05 18:06:33 -0700
committerJosh Rahm <rahm@google.com>2023-12-05 18:06:33 -0700
commit8d67f1ea8c614f12ddfc77d5727fb7fd8472484b (patch)
treed048a9d74954c616340162198d51dea36d5b942c /src/Rahm/Desktop/StackSet.hs
parent122b51770305f3f22050ba7000d168e298eb1661 (diff)
downloadrde-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.hs8
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