diff options
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 |