diff options
| author | Josh Rahm <rahm@google.com> | 2022-04-14 12:11:45 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:46 -0600 |
| commit | abda4cacc12e0c80193eb35aefbd542cbdec5aa8 (patch) | |
| tree | 5190083da7446ab50808429d261d5725af719bec /src/Rahm/Desktop/Workspaces.hs | |
| parent | 96120d6260e37877696d6ddb02511d39362714c1 (diff) | |
| download | rde-abda4cacc12e0c80193eb35aefbd542cbdec5aa8.tar.gz rde-abda4cacc12e0c80193eb35aefbd542cbdec5aa8.tar.bz2 rde-abda4cacc12e0c80193eb35aefbd542cbdec5aa8.zip | |
Minor changes
Diffstat (limited to 'src/Rahm/Desktop/Workspaces.hs')
| -rw-r--r-- | src/Rahm/Desktop/Workspaces.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Rahm/Desktop/Workspaces.hs b/src/Rahm/Desktop/Workspaces.hs index 2a266b7..1349fea 100644 --- a/src/Rahm/Desktop/Workspaces.hs +++ b/src/Rahm/Desktop/Workspaces.hs @@ -113,8 +113,8 @@ swapWorkspace toWorkspace = do | t' == toWorkspace = W.Workspace fromWorkspace l s | otherwise = ws -adjacentWorkspace :: Selector -> WorkspaceId -> X WorkspaceId -adjacentWorkspace (Selector selector) from = +adjacentWorkspaceNotVisible :: Selector -> WorkspaceId -> X WorkspaceId +adjacentWorkspaceNotVisible (Selector selector) from = withWindowSet $ \ss -> let tags = sort $ W.tag . snd <$> filter (\x -> fst x /= Visible) ( @@ -122,9 +122,16 @@ adjacentWorkspace (Selector selector) from = in return $ fromMaybe from $ selector (==from) tags +adjacentWorkspace :: Selector -> WorkspaceId -> X WorkspaceId +adjacentWorkspace (Selector selector) from = + withWindowSet $ \ss -> + let tags = sort $ W.tag . snd <$> getPopulatedWorkspaces ss + in + return $ fromMaybe from $ selector (==from) tags + viewAdjacent :: Selector -> X () viewAdjacent sel = - gotoWorkspace =<< (adjacentWorkspace sel =<< getCurrentWorkspace) + gotoWorkspace =<< (adjacentWorkspaceNotVisible sel =<< getCurrentWorkspace) adjacentScreen :: Selector -> X WorkspaceId adjacentScreen (Selector f) = do |