mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.H.FloatConfigureReq: Add fixSteamFlicker
For ease of use, provide `fixSteamFlicker` as a pre-packaged `floatConfReqHook` that can easily be added directly to a `handleEventHook`. Also, for discoverability, re-export it from X.U.Hacks.
This commit is contained in:
parent
2b77997259
commit
c33efbbefd
@ -25,6 +25,10 @@ module XMonad.Hooks.FloatConfigureReq (
|
|||||||
-- $usage
|
-- $usage
|
||||||
MaybeMaybeManageHook,
|
MaybeMaybeManageHook,
|
||||||
floatConfReqHook,
|
floatConfReqHook,
|
||||||
|
|
||||||
|
-- * Known workarounds
|
||||||
|
fixSteamFlicker,
|
||||||
|
fixSteamFlickerMMMH,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
@ -66,6 +70,10 @@ import qualified XMonad.StackSet as W
|
|||||||
-- meaningful in the context of a tiling WM):
|
-- meaningful in the context of a tiling WM):
|
||||||
--
|
--
|
||||||
-- > map toLower `fmap` className =? "steam" -?> mempty
|
-- > map toLower `fmap` className =? "steam" -?> mempty
|
||||||
|
--
|
||||||
|
-- (this example is also available as 'fixSteamFlickerMMMH' to be added to
|
||||||
|
-- one's @myFloatConfReqHook@ and also 'fixSteamFlicker' to be added directly
|
||||||
|
-- to one's 'handleEventHook')
|
||||||
|
|
||||||
-- | A variant of 'MaybeManageHook' that additionally may or may not make
|
-- | A variant of 'MaybeManageHook' that additionally may or may not make
|
||||||
-- changes to the 'WindowSet'.
|
-- changes to the 'WindowSet'.
|
||||||
@ -107,3 +115,12 @@ floatConfReqHook _ _ = mempty
|
|||||||
-- | A 'Query' to determine if a window is floating.
|
-- | A 'Query' to determine if a window is floating.
|
||||||
isFloatQ :: Query Bool
|
isFloatQ :: Query Bool
|
||||||
isFloatQ = ask >>= \w -> liftX . gets $ M.member w . W.floating . windowset
|
isFloatQ = ask >>= \w -> liftX . gets $ M.member w . W.floating . windowset
|
||||||
|
|
||||||
|
-- | A pre-packaged 'floatConfReqHook' that fixes flickering of the Steam client by ignoring 'ConfigureRequestEvent's on any of its floating windows.
|
||||||
|
--
|
||||||
|
-- To use this, add 'fixSteamFlicker' to your 'handleEventHook'.
|
||||||
|
fixSteamFlicker :: Event -> X All
|
||||||
|
fixSteamFlicker = floatConfReqHook fixSteamFlickerMMMH
|
||||||
|
|
||||||
|
fixSteamFlickerMMMH :: MaybeMaybeManageHook
|
||||||
|
fixSteamFlickerMMMH = map toLower `fmap` className =? "steam" -?> mempty
|
||||||
|
@ -40,10 +40,14 @@ module XMonad.Util.Hacks (
|
|||||||
trayerPaddingXmobarEventHook,
|
trayerPaddingXmobarEventHook,
|
||||||
trayPaddingXmobarEventHook,
|
trayPaddingXmobarEventHook,
|
||||||
trayPaddingEventHook,
|
trayPaddingEventHook,
|
||||||
|
|
||||||
|
-- * Steam flickering fix
|
||||||
|
fixSteamFlicker,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
|
||||||
import XMonad
|
import XMonad
|
||||||
|
import XMonad.Hooks.FloatConfigureReq (fixSteamFlicker)
|
||||||
import XMonad.Hooks.StatusBar (xmonadPropLog')
|
import XMonad.Hooks.StatusBar (xmonadPropLog')
|
||||||
import XMonad.Prelude (All (All), fi, filterM, when)
|
import XMonad.Prelude (All (All), fi, filterM, when)
|
||||||
import System.Posix.Env (putEnv)
|
import System.Posix.Env (putEnv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user