diff options
author | David Roundy <droundy@darcs.net> | 2008-03-11 23:12:01 +0100 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2008-03-11 23:12:01 +0100 |
commit | 5c93a91c35c76dd1b9ebcbe290b6bcd3c8617877 (patch) | |
tree | 8534d3b5e68d4b453f065dcfc458ef542c50d825 | |
parent | 0af2024503aa6626490a254ef177797ace5d55a6 (diff) | |
download | XMonadContrib-5c93a91c35c76dd1b9ebcbe290b6bcd3c8617877.tar.gz XMonadContrib-5c93a91c35c76dd1b9ebcbe290b6bcd3c8617877.tar.xz XMonadContrib-5c93a91c35c76dd1b9ebcbe290b6bcd3c8617877.zip |
fix WorkspaceDir to work when there are multiple screens.
In particlar, ScratchWorkspace broke this.
darcs-hash:20080311221201-72aca-7cc571b5b614f90ed559d4a1e37556c84ee88425.gz
-rw-r--r-- | XMonad/Layout/WorkspaceDir.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/XMonad/Layout/WorkspaceDir.hs b/XMonad/Layout/WorkspaceDir.hs index d7ff24e..f550f46 100644 --- a/XMonad/Layout/WorkspaceDir.hs +++ b/XMonad/Layout/WorkspaceDir.hs @@ -30,12 +30,14 @@ module XMonad.Layout.WorkspaceDir ( ) where import System.Directory ( setCurrentDirectory, getCurrentDirectory ) +import Control.Monad ( when ) -import XMonad +import XMonad hiding ( focus ) import XMonad.Util.Run ( runProcessWithInput ) import XMonad.Prompt ( XPConfig ) import XMonad.Prompt.Directory ( directoryPrompt ) import XMonad.Layout.LayoutModifier +import XMonad.StackSet ( Stack, peek, focus ) -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -66,8 +68,10 @@ instance Message Chdir data WorkspaceDir a = WorkspaceDir String deriving ( Read, Show ) -instance LayoutModifier WorkspaceDir a where - hook (WorkspaceDir s) = scd s +instance LayoutModifier WorkspaceDir Window where + 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' |