From 6946bbc48b0f408c342b7d3cae09f7da41c74fbd Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sun, 16 May 2021 14:36:59 +0100 Subject: [PATCH] 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 --- XMonad/Hooks/EwmhDesktops.hs | 7 +++---- XMonad/Layout/Fullscreen.hs | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index be2a57c47b..1bc8e1daa3 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -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 diff --git a/XMonad/Layout/Fullscreen.hs b/XMonad/Layout/Fullscreen.hs index 9554d44d6f..dc431f569b 100644 --- a/XMonad/Layout/Fullscreen.hs +++ b/XMonad/Layout/Fullscreen.hs @@ -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