[XMonad] Disable focus follows mouse when magic foucus is active

This commit is contained in:
Ivan Malison 2016-11-24 16:39:09 -08:00
parent 35b5405ef7
commit b7afda3c4c
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -56,7 +56,8 @@ main = xmonad $ def
, layoutHook = myLayoutHook , layoutHook = myLayoutHook
, logHook = toggleFadeInactiveLogHook 0.9 +++ ewmhWorkspaceNamesLogHook , logHook = toggleFadeInactiveLogHook 0.9 +++ ewmhWorkspaceNamesLogHook
, handleEventHook = docksEventHook <+> fullscreenEventHook +++ , handleEventHook = docksEventHook <+> fullscreenEventHook +++
ewmhDesktopsEventHook +++ pagerHintsEventHook ewmhDesktopsEventHook +++ pagerHintsEventHook +++
followIfNoMagicFocus
, startupHook = myStartup +++ ewmhWorkspaceNamesLogHook , startupHook = myStartup +++ ewmhWorkspaceNamesLogHook
, keys = customKeys (const []) addKeys , keys = customKeys (const []) addKeys
} where } where
@ -116,10 +117,12 @@ instance Transformer MyToggles Window where
transform GAPS x k = k (smartSpacing 5 x) unmodifyLayout transform GAPS x k = k (smartSpacing 5 x) unmodifyLayout
transform MAGICFOCUS x k = k (magicFocus x) unmodifyLayout transform MAGICFOCUS x k = k (magicFocus x) unmodifyLayout
-- TODO: Figure out how to disable focus follows mouse for magicFocus
myToggles = [LIMIT, GAPS, MAGICFOCUS] myToggles = [LIMIT, GAPS, MAGICFOCUS]
otherToggles = [NBFULL, MIRROR] otherToggles = [NBFULL, MIRROR]
followIfNoMagicFocus = followOnlyIf $ fmap (fromMaybe False . fmap not) $
isToggleActive MAGICFOCUS
togglesMap = fmap M.fromList $ sequence $ togglesMap = fmap M.fromList $ sequence $
map toggleTuple myToggles ++ map toggleTuple otherToggles map toggleTuple myToggles ++ map toggleTuple otherToggles
where where