diff options
| author | Josh Rahm <rahm@google.com> | 2023-12-08 16:14:05 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2023-12-08 16:14:05 -0700 |
| commit | 8bbc3ce0d0ae10b5e7630779c970f38f0a767789 (patch) | |
| tree | 8d31ec2a97dd0ae880e2a5e3a2c29b8331d22976 /src/Rahm/Desktop/StackSet.hs | |
| parent | 718d69736e5dfd946648e7a305c15281d9656466 (diff) | |
| parent | 9f176adbff807dafec2caee5e3b104e65caf9029 (diff) | |
| download | rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.tar.gz rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.tar.bz2 rde-8bbc3ce0d0ae10b5e7630779c970f38f0a767789.zip | |
Merge branch 'pinwindow'
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 2dc8787..94c044e 100644 --- a/src/Rahm/Desktop/StackSet.hs +++ b/src/Rahm/Desktop/StackSet.hs @@ -1,6 +1,7 @@ module Rahm.Desktop.StackSet ( masterWindow, allVisibleWindows, + shiftWinNoFocus, differentiateWithFocus, concatMapTiledWindows, windowsOnWorkspace, @@ -273,6 +274,13 @@ differentiateWithFocus thing lst = getFocusedWindow :: StackSet i l a s sd -> Maybe a getFocusedWindow (StackSet cur _ _ _) = W.focus <$> (W.stack . W.workspace) cur +shiftWinNoFocus :: (Ord a, Eq s, Eq i) => i -> a -> StackSet i l a s sd -> StackSet i l a s sd +shiftWinNoFocus n w s = case findTag w s of + Just from | n `tagMember` s && n /= from -> go from s + _ -> s + where go from = onWorkspace n (focusDown . insertUp w) . onWorkspace from (delete' w) + onWorkspace n f s = view (currentTag s) . f . view n $ s + sinkBy :: (Eq a, Eq i, Ord a) => a -> a -> StackSet i l a s sd -> StackSet i l a s sd sinkBy win toSinkBy ss = case (findTag win ss, findTag toSinkBy ss) of |