X.{H.EwmhDesktops,L.Fullscreen}: Kill a few warnings

Related: https://github.com/xmonad/xmonad-contrib/issues/396
Related: https://github.com/xmonad/xmonad-contrib/pull/399
This commit is contained in:
Tomas Janousek 2021-05-16 14:36:59 +01:00
parent 2c1c96c3e5
commit 6946bbc48b
2 changed files with 4 additions and 7 deletions

View File

@ -160,9 +160,9 @@ whenChanged v action = do
-- Generalized version of ewmhDesktopsLogHook that allows an arbitrary
-- user-specified function to transform the workspace list (post-sorting)
ewmhDesktopsLogHookCustom :: ([WindowSpace] -> [WindowSpace]) -> X ()
ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do
ewmhDesktopsLogHookCustom t = withWindowSet $ \s -> do
sort' <- getSortByIndex
let ws = f $ sort' $ W.workspaces s
let ws = t $ sort' $ W.workspaces s
-- Set number of workspaces and names thereof
let desktopNames = map W.tag ws
@ -175,7 +175,7 @@ ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do
whenChanged (ClientList clientList) $ setClientList clientList
-- Remap the current workspace to handle any renames that f might be doing.
let maybeCurrent' = W.tag <$> listToMaybe (f [W.workspace $ W.current s])
let maybeCurrent' = W.tag <$> listToMaybe (t [W.workspace $ W.current s])
current = join (flip elemIndex (map W.tag ws) <$> maybeCurrent')
whenChanged (CurrentDesktop $ fromMaybe 0 current) $
mapM_ setCurrentDesktop current
@ -388,7 +388,6 @@ addSupported :: [String] -> X ()
addSupported props = withDisplay $ \dpy -> do
r <- asks theRoot
a <- getAtom "_NET_SUPPORTED"
fs <- getAtom "_NET_WM_STATE_FULLSCREEN"
newSupportedList <- mapM (fmap fromIntegral . getAtom) props
io $ do
supportedList <- fmap (join . maybeToList) $ getWindowProperty32 dpy a r

View File

@ -213,9 +213,7 @@ fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do
wmstate <- getAtom "_NET_WM_STATE"
fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
wstate <- fromMaybe [] <$> getProp32 wmstate win
let fi :: (Integral i, Num n) => i -> n
fi = fromIntegral
isFull = fi fullsc `elem` wstate
let isFull = fi fullsc `elem` wstate
remove = 0
add = 1
toggle = 2