Skip to content

Commit

Permalink
X.{H.EwmhDesktops,L.Fullscreen}: Kill a few warnings
Browse files Browse the repository at this point in the history
Related: xmonad#396
Related: xmonad#399
  • Loading branch information
liskin authored and TheMC47 committed May 21, 2021
1 parent bc5c12e commit 99e8b05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 3 additions & 4 deletions XMonad/Hooks/EwmhDesktops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions XMonad/Layout/Fullscreen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99e8b05

Please sign in to comment.