make workspaceDir work even in workspaces with no windows.

This also fixes a (minor) bug when the focussed window is present on
multiple visible workspaces.
This commit is contained in:
David Roundy
2008-03-26 15:27:08 +00:00
parent e17d039c3a
commit 296b0b2513

View File

@@ -69,9 +69,9 @@ instance Message Chdir
data WorkspaceDir a = WorkspaceDir String deriving ( Read, Show )
instance LayoutModifier WorkspaceDir Window where
modifyLayout (WorkspaceDir d) w r = do tc <- gets (tag . current . windowset)
when (tc == tag w) $ scd d
runLayout w r
redoLayout (WorkspaceDir d) _ s wrs = do w <- gets windowset
when (Just (focus s) == peek w) $ scd d
return (wrs, Nothing)
handleMess (WorkspaceDir _) m
| Just (Chdir wd) <- fromMessage m = do wd' <- cleanDir wd
return $ Just $ WorkspaceDir wd'