Fixes for windowset -> workspace rename

This commit is contained in:
Spencer Janssen
2007-05-21 04:21:18 +00:00
parent 325c2b90c5
commit 2b171ea19c
6 changed files with 8 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ runProcessWithInput cmd args input = do
-- http://www.jcreigh.com/dmenu/dmenu-2.8-xinerama.patch -- http://www.jcreigh.com/dmenu/dmenu-2.8-xinerama.patch
dmenuXinerama :: [String] -> X String dmenuXinerama :: [String] -> X String
dmenuXinerama opts = do dmenuXinerama opts = do
ws <- gets workspace ws <- gets windowset
let curscreen = fromIntegral $ fromMaybe 0 (M.lookup (W.current ws) (W.ws2screen ws)) :: Int let curscreen = fromIntegral $ fromMaybe 0 (M.lookup (W.current ws) (W.ws2screen ws)) :: Int
io $ runProcessWithInput "dmenu" ["-xs", show (curscreen+1)] (unlines opts) io $ runProcessWithInput "dmenu" ["-xs", show (curscreen+1)] (unlines opts)

View File

@@ -41,7 +41,7 @@ findEmptyWorkspace = findKey (([],[]) ==) . W.stacks
withEmptyWorkspace :: (WorkspaceId -> X ()) -> X () withEmptyWorkspace :: (WorkspaceId -> X ()) -> X ()
withEmptyWorkspace f = do withEmptyWorkspace f = do
ws <- gets workspace ws <- gets windowset
whenJust (findEmptyWorkspace ws) f whenJust (findEmptyWorkspace ws) f
-- | Find and view an empty workspace. Do nothing if all workspaces are -- | Find and view an empty workspace. Do nothing if all workspaces are

View File

@@ -204,5 +204,5 @@ unName :: NamedWindow -> Window
unName (NW _ w) = w unName (NW _ w) = w
withNamedWindow :: (NamedWindow -> X ()) -> X () withNamedWindow :: (NamedWindow -> X ()) -> X ()
withNamedWindow f = do ws <- gets workspace withNamedWindow f = do ws <- gets windowset
whenJust (W.peek ws) $ \w -> getName w >>= f whenJust (W.peek ws) $ \w -> getName w >>= f

View File

@@ -18,7 +18,7 @@ import Data.Maybe ( listToMaybe )
import qualified StackSet as W ( stacks, current, visibleWorkspaces, index ) import qualified StackSet as W ( stacks, current, visibleWorkspaces, index )
rotView :: Bool -> X () rotView :: Bool -> X ()
rotView b = do ws <- gets workspace rotView b = do ws <- gets windowset
let m = W.current ws let m = W.current ws
vis = W.visibleWorkspaces ws vis = W.visibleWorkspaces ws
allws = if b then allWorkspaces ws else reverse $ allWorkspaces ws allws = if b then allWorkspaces ws else reverse $ allWorkspaces ws

View File

@@ -10,7 +10,7 @@ module XMonadContrib.SwapFocus ( swapFocus ) where
import Control.Monad.State import Control.Monad.State
import Operations ( refresh ) import Operations ( refresh )
import XMonad ( X, WindowSet, workspace ) import XMonad ( X, WindowSet, windowset )
import StackSet ( StackSet, peekStack, popFocus, pushFocus, current ) import StackSet ( StackSet, peekStack, popFocus, pushFocus, current )
sf :: (Integral i, Integral j, Ord a) => StackSet i j a -> Maybe (StackSet i j a) sf :: (Integral i, Integral j, Ord a) => StackSet i j a -> Maybe (StackSet i j a)
@@ -24,7 +24,7 @@ swapFocus = smartwindows sf
-- | smartwindows. Modify the current window list with a pure function, and only refresh if necesary -- | smartwindows. Modify the current window list with a pure function, and only refresh if necesary
smartwindows :: (WindowSet -> Maybe WindowSet) -> X () smartwindows :: (WindowSet -> Maybe WindowSet) -> X ()
smartwindows f = do w <- gets workspace smartwindows f = do w <- gets windowset
case (f w) of Just f' -> do modify $ \s -> s { workspace = f' } case (f w) of Just f' -> do modify $ \s -> s { windowset = f' }
refresh refresh
Nothing -> return () Nothing -> return ()

View File

@@ -16,7 +16,7 @@ twoPane :: Rational -> Rational -> Layout
twoPane delta split = Layout { doLayout = arrange, modifyLayout = message } twoPane delta split = Layout { doLayout = arrange, modifyLayout = message }
where where
arrange rect ws@(w:x:_) = do arrange rect ws@(w:x:_) = do
(Just f) <- gets (W.peek . workspace) -- safe because of pattern match above (Just f) <- gets (W.peek . windowset) -- safe because of pattern match above
let y = if f == w then x else f let y = if f == w then x else f
(left, right) = splitHorizontallyBy split rect (left, right) = splitHorizontallyBy split rect
mapM_ hide . filter (\a -> a /= w && a /= y) $ ws mapM_ hide . filter (\a -> a /= w && a /= y) $ ws