diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-12-19 01:38:24 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-12-19 01:38:24 +0100 |
commit | 1beaad7b2eaf40dbde3174a0ac9d3e891482c57f (patch) | |
tree | 7834fd64a45cd524aa635469ea7374a93433cf6a /XMonad/Hooks | |
parent | d48e7a09bb12ade68ed7dc4616210be94b77ed28 (diff) | |
download | XMonadContrib-1beaad7b2eaf40dbde3174a0ac9d3e891482c57f.tar.gz XMonadContrib-1beaad7b2eaf40dbde3174a0ac9d3e891482c57f.tar.xz XMonadContrib-1beaad7b2eaf40dbde3174a0ac9d3e891482c57f.zip |
Style changes in EwmhDesktops
Ignore-this: 905eff9ed951955c8f62617b2d82302e
darcs-hash:20091219003824-1499c-8431cb12b4658c0143a41ecdbdb17f731bfd8f12.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad/Hooks/EwmhDesktops.hs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index a82e449..becd778 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -161,29 +161,26 @@ handle _ = return () -- _NET_WM_STATE protocol. This includes users of the gtk_window_fullscreen() -- function, such as Totem, Evince and OpenOffice.org. fullscreenEventHook :: Event -> X All -fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ dat) = do +fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do state <- getAtom "_NET_WM_STATE" fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN" - wstate' <- getProp32 state win - let wstate = case wstate' of - Just ps -> ps - Nothing -> [] - isFull = fromIntegral fullsc `elem` wstate + wstate <- fromMaybe [] `fmap` getProp32 state win + + let isFull = fromIntegral fullsc `elem` wstate -- Constants for the _NET_WM_STATE protocol: remove = 0 add = 1 toggle = 2 - - action = head dat ptype = 4 -- The atom property type for changeProperty + chWstate f = io $ changeProperty32 dpy win state ptype propModeReplace (f wstate) - when (typ == state && fromIntegral fullsc `elem` tail dat) $ do + when (typ == state && fi fullsc `elem` dats) $ do when (action == add || (action == toggle && not isFull)) $ do - io $ changeProperty32 dpy win state ptype propModeReplace (fromIntegral fullsc:wstate) + chWstate (fi fullsc:) windows $ W.float win $ W.RationalRect 0 0 1 1 when (action == remove || (action == toggle && isFull)) $ do - io $ changeProperty32 dpy win state ptype propModeReplace (delete (fromIntegral fullsc) wstate) + chWstate $ delete (fi fullsc) windows $ W.sink win return $ All True |