mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
XMonad.Layout.ScratchWorkspace: avoid warnings, make tests compile again
This commit is contained in:
@@ -39,9 +39,11 @@ toggleScratchWorkspace l =
|
|||||||
pickRect _ [z] = z
|
pickRect _ [z] = z
|
||||||
pickRect i (z:zs) | i < 1 = z
|
pickRect i (z:zs) | i < 1 = z
|
||||||
| otherwise = pickRect (i-1) zs
|
| 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
|
s' = case catMaybes $ map modscr $ W.current s : W.visible s of
|
||||||
newc:newv -> s { W.current = newc, W.visible = newv,
|
newc:newv -> s { W.current = newc, W.visible = newv,
|
||||||
W.hidden = W.workspace scratch : W.hidden s}
|
W.hidden = W.workspace scratch : W.hidden s}
|
||||||
|
[] -> error "XMonad.Layout.ScratchWorkspace.toggleScratchWorkspace: internal error"
|
||||||
modify $ \st -> st { windowset = s' }
|
modify $ \st -> st { windowset = s' }
|
||||||
refresh
|
refresh
|
||||||
Nothing ->
|
Nothing ->
|
||||||
@@ -62,16 +64,15 @@ toggleScratchWorkspace l =
|
|||||||
W.hidden = filter (not . isScratchW) $ W.hidden s }
|
W.hidden = filter (not . isScratchW) $ W.hidden s }
|
||||||
modify $ \st -> st { windowset = s' }
|
modify $ \st -> st { windowset = s' }
|
||||||
refresh
|
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 :: String
|
||||||
scratchName = "*scratch*"
|
scratchName = "*scratch*"
|
||||||
|
|
||||||
visibleScratch s = listToMaybe $ filter isScratch $ W.current s : W.visible s
|
-- isScratchVisible :: X Bool
|
||||||
hiddenScratch s = listToMaybe $ filter isScratchW $ W.hidden s
|
-- isScratchVisible = gets (elem scratchName . map (W.tag . W.workspace) . W.visible . windowset)
|
||||||
|
|
||||||
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)
|
|
||||||
|
Reference in New Issue
Block a user