mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
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:
parent
2c1c96c3e5
commit
6946bbc48b
@ -160,9 +160,9 @@ whenChanged v action = do
|
|||||||
-- Generalized version of ewmhDesktopsLogHook that allows an arbitrary
|
-- Generalized version of ewmhDesktopsLogHook that allows an arbitrary
|
||||||
-- user-specified function to transform the workspace list (post-sorting)
|
-- user-specified function to transform the workspace list (post-sorting)
|
||||||
ewmhDesktopsLogHookCustom :: ([WindowSpace] -> [WindowSpace]) -> X ()
|
ewmhDesktopsLogHookCustom :: ([WindowSpace] -> [WindowSpace]) -> X ()
|
||||||
ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do
|
ewmhDesktopsLogHookCustom t = withWindowSet $ \s -> do
|
||||||
sort' <- getSortByIndex
|
sort' <- getSortByIndex
|
||||||
let ws = f $ sort' $ W.workspaces s
|
let ws = t $ sort' $ W.workspaces s
|
||||||
|
|
||||||
-- Set number of workspaces and names thereof
|
-- Set number of workspaces and names thereof
|
||||||
let desktopNames = map W.tag ws
|
let desktopNames = map W.tag ws
|
||||||
@ -175,7 +175,7 @@ ewmhDesktopsLogHookCustom f = withWindowSet $ \s -> do
|
|||||||
whenChanged (ClientList clientList) $ setClientList clientList
|
whenChanged (ClientList clientList) $ setClientList clientList
|
||||||
|
|
||||||
-- Remap the current workspace to handle any renames that f might be doing.
|
-- 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')
|
current = join (flip elemIndex (map W.tag ws) <$> maybeCurrent')
|
||||||
whenChanged (CurrentDesktop $ fromMaybe 0 current) $
|
whenChanged (CurrentDesktop $ fromMaybe 0 current) $
|
||||||
mapM_ setCurrentDesktop current
|
mapM_ setCurrentDesktop current
|
||||||
@ -388,7 +388,6 @@ addSupported :: [String] -> X ()
|
|||||||
addSupported props = withDisplay $ \dpy -> do
|
addSupported props = withDisplay $ \dpy -> do
|
||||||
r <- asks theRoot
|
r <- asks theRoot
|
||||||
a <- getAtom "_NET_SUPPORTED"
|
a <- getAtom "_NET_SUPPORTED"
|
||||||
fs <- getAtom "_NET_WM_STATE_FULLSCREEN"
|
|
||||||
newSupportedList <- mapM (fmap fromIntegral . getAtom) props
|
newSupportedList <- mapM (fmap fromIntegral . getAtom) props
|
||||||
io $ do
|
io $ do
|
||||||
supportedList <- fmap (join . maybeToList) $ getWindowProperty32 dpy a r
|
supportedList <- fmap (join . maybeToList) $ getWindowProperty32 dpy a r
|
||||||
|
@ -213,9 +213,7 @@ fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do
|
|||||||
wmstate <- getAtom "_NET_WM_STATE"
|
wmstate <- getAtom "_NET_WM_STATE"
|
||||||
fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
|
fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
|
||||||
wstate <- fromMaybe [] <$> getProp32 wmstate win
|
wstate <- fromMaybe [] <$> getProp32 wmstate win
|
||||||
let fi :: (Integral i, Num n) => i -> n
|
let isFull = fi fullsc `elem` wstate
|
||||||
fi = fromIntegral
|
|
||||||
isFull = fi fullsc `elem` wstate
|
|
||||||
remove = 0
|
remove = 0
|
||||||
add = 1
|
add = 1
|
||||||
toggle = 2
|
toggle = 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user