From fff5ddb53f4eda07c3cbd1caae236e5edd8ea4bc Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Fri, 9 Nov 2012 02:23:16 +0100 Subject: Rename variables "state" to avoid warnings about shadowing Ignore-this: cd063d632412f758ca9fed6393521c8f XMonad core re-exports Control.Monad.State, which includes a function "state" if you happen to use mtl-2. Since there's a chance xmonad still works with mtl-1 avoid imports like: import XMonad hiding (state) darcs-hash:20121109012316-1499c-539514f4cd97ba8b18a8fbfd1a15333b46d962e1.gz --- XMonad/Hooks/DynamicBars.hs | 6 +++--- XMonad/Hooks/EwmhDesktops.hs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'XMonad/Hooks') diff --git a/XMonad/Hooks/DynamicBars.hs b/XMonad/Hooks/DynamicBars.hs index d8c40fe..993aec5 100644 --- a/XMonad/Hooks/DynamicBars.hs +++ b/XMonad/Hooks/DynamicBars.hs @@ -112,11 +112,11 @@ multiPP focusPP unfocusPP = do multiPP' :: (PP -> X String) -> PP -> PP -> [Handle] -> X () multiPP' dynlStr focusPP unfocusPP handles = do - state <- get + st <- get let pickPP :: WorkspaceId -> WriterT (Last XState) X String pickPP ws = do - let isFoc = (ws ==) . W.tag . W.workspace . W.current $ windowset state - put state{ windowset = W.view ws $ windowset state } + let isFoc = (ws ==) . W.tag . W.workspace . W.current $ windowset st + put st{ windowset = W.view ws $ windowset st } out <- lift $ dynlStr $ if isFoc then focusPP else unfocusPP when isFoc $ get >>= tell . Last . Just return out diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index b3bed77..060079a 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -170,9 +170,9 @@ handle _ _ = return () -- Note this is not included in 'ewmh'. fullscreenEventHook :: Event -> X All fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do - state <- getAtom "_NET_WM_STATE" + wmstate <- getAtom "_NET_WM_STATE" fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN" - wstate <- fromMaybe [] `fmap` getProp32 state win + wstate <- fromMaybe [] `fmap` getProp32 wmstate win let isFull = fromIntegral fullsc `elem` wstate @@ -181,9 +181,9 @@ fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do add = 1 toggle = 2 ptype = 4 -- The atom property type for changeProperty - chWstate f = io $ changeProperty32 dpy win state ptype propModeReplace (f wstate) + chWstate f = io $ changeProperty32 dpy win wmstate ptype propModeReplace (f wstate) - when (typ == state && fi fullsc `elem` dats) $ do + when (typ == wmstate && fi fullsc `elem` dats) $ do when (action == add || (action == toggle && not isFull)) $ do chWstate (fi fullsc:) windows $ W.float win $ W.RationalRect 0 0 1 1 -- cgit v1.2.3