diff options
author | Lukas Mai <l.mai@web.de> | 2008-03-01 07:16:25 +0100 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2008-03-01 07:16:25 +0100 |
commit | efc024c8c59147f9e195796b5241e275685fcefe (patch) | |
tree | 21ea96eaf9c2a423cd966e6bf286b9c7945fab18 /XMonad/Layout | |
parent | 3433ac66496a153487c24a2c80230e5274658352 (diff) | |
download | XMonadContrib-efc024c8c59147f9e195796b5241e275685fcefe.tar.gz XMonadContrib-efc024c8c59147f9e195796b5241e275685fcefe.tar.xz XMonadContrib-efc024c8c59147f9e195796b5241e275685fcefe.zip |
XMonad.Layout.ScratchWorkspace: avoid warnings, make tests compile again
darcs-hash:20080301061625-462cf-1074e16910784ae464922a611c979ddd355e3e4e.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/ScratchWorkspace.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/XMonad/Layout/ScratchWorkspace.hs b/XMonad/Layout/ScratchWorkspace.hs index 04b18bd..fb88ae8 100644 --- a/XMonad/Layout/ScratchWorkspace.hs +++ b/XMonad/Layout/ScratchWorkspace.hs @@ -39,9 +39,11 @@ toggleScratchWorkspace l = pickRect _ [z] = z pickRect i (z:zs) | i < 1 = z | otherwise = pickRect (i-1) zs + pickRect _ [] = error "XMonad.Layout.ScratchWorkspace.toggleScratchWorkspace: internal error" s' = case catMaybes $ map modscr $ W.current s : W.visible s of newc:newv -> s { W.current = newc, W.visible = newv, W.hidden = W.workspace scratch : W.hidden s} + [] -> error "XMonad.Layout.ScratchWorkspace.toggleScratchWorkspace: internal error" modify $ \st -> st { windowset = s' } refresh Nothing -> @@ -62,16 +64,15 @@ toggleScratchWorkspace l = W.hidden = filter (not . isScratchW) $ W.hidden s } modify $ \st -> st { windowset = s' } refresh + where visibleScratch s = listToMaybe $ filter isScratch $ W.current s : W.visible s + hiddenScratch s = listToMaybe $ filter isScratchW $ W.hidden s + isScratchW w = scratchName == W.tag w + isScratch scr = scratchName == W.tag (W.workspace scr) +-- notScratch scr = scratchName /= W.tag (W.workspace scr) + scratchName :: String scratchName = "*scratch*" -visibleScratch s = listToMaybe $ filter isScratch $ W.current s : W.visible s -hiddenScratch s = listToMaybe $ filter isScratchW $ W.hidden s - -isScratchW w = scratchName == W.tag w -isScratch scr = scratchName == W.tag (W.workspace scr) -notScratch scr = scratchName /= W.tag (W.workspace scr) - -isScratchVisible :: X Bool -isScratchVisible = gets (elem scratchName . map (W.tag . W.workspace) . W.visible . windowset) +-- isScratchVisible :: X Bool +-- isScratchVisible = gets (elem scratchName . map (W.tag . W.workspace) . W.visible . windowset) |