Remove evHook hack
This commit is contained in:
parent
9da6abc95a
commit
b9536828bf
1 changed files with 1 additions and 34 deletions
|
|
@ -152,39 +152,6 @@ gsConfig = defaultGSConfig
|
|||
|
||||
gsConfig = defaultGSConfig
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Fullscreen hack from http://code.google.com/p/xmonad/issues/detail?id=339
|
||||
|
||||
-- Helper functions to fullscreen the window
|
||||
fullFloat, tileWin :: Window -> X ()
|
||||
fullFloat w = windows $ W.float w r
|
||||
where r = W.RationalRect 0 0 1 1
|
||||
tileWin w = windows $ W.sink w
|
||||
|
||||
evHook :: Event -> X All
|
||||
evHook (ClientMessageEvent _ _ _ dpy win typ dat) = do
|
||||
state <- getAtom "_NET_WM_STATE"
|
||||
fullsc <- getAtom "_NET_WM_STATE_FULLSCREEN"
|
||||
isFull <- runQuery isFullscreen win
|
||||
-- Constants for the _NET_WM_STATE protocol
|
||||
let remove = 0
|
||||
add = 1
|
||||
toggle = 2
|
||||
-- The ATOM property type for changeProperty
|
||||
ptype = 4
|
||||
action = head dat
|
||||
when (typ == state && (fromIntegral fullsc) `elem` tail dat) $ do
|
||||
when (action == add || (action == toggle && not isFull)) $ do
|
||||
io $ changeProperty32 dpy win state ptype propModeReplace [fromIntegral fullsc]
|
||||
fullFloat win
|
||||
when (head dat == remove || (action == toggle && isFull)) $ do
|
||||
io $ changeProperty32 dpy win state ptype propModeReplace []
|
||||
tileWin win
|
||||
-- It shouldn't be necessary for xmonad to do anything more with this event
|
||||
return $ All False
|
||||
evHook _ = return $ All True
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Layouts:
|
||||
|
||||
|
|
@ -297,7 +264,7 @@ mConfig = defaultConfig
|
|||
, layoutHook = mLayout
|
||||
--, manageHook = manageSpawn sp <+> mManageHook
|
||||
, manageHook = mManageHook
|
||||
, handleEventHook = pickyFocusEventHook >> evHook
|
||||
, handleEventHook = pickyFocusEventHook
|
||||
, startupHook = do
|
||||
ewmhDesktopsStartup >> setWMName "LG3D"
|
||||
return () >> checkKeymap mConfig mKeys
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue