Skip to content

Commit d690f7f

Browse files
committed
X.H.EwmhDesktops: Fix menus in Steam client
More specifically, ignore ClientMessageEvents for unmanaged windows. Steam likes to send _NET_ACTIVE_WINDOW requests for all its windows, including override-redirect ones, which used to result in an invocation of `windows` with a no-op Endo—equivalent to a call to `refresh`. But this refresh makes Steam close its menus immediately. Fixes: ValveSoftware/steam-for-linux#9376 Related: xmonad/xmonad#451
1 parent 8efff53 commit d690f7f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

XMonad/Hooks/EwmhDesktops.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,14 @@ ewmhDesktopsEventHook'
459459
a_aw <- getAtom "_NET_ACTIVE_WINDOW"
460460
a_cw <- getAtom "_NET_CLOSE_WINDOW"
461461

462-
if | mt == a_cd, n : _ <- d, Just ww <- ws !? fi n ->
462+
if | mt == a_cw ->
463+
killWindow w
464+
| not (w `W.member` s) ->
465+
-- do nothing for unmanaged windows; it'd be just a useless
466+
-- refresh which breaks menus/popups of misbehaving apps that
467+
-- send _NET_ACTIVE_WINDOW requests for override-redirect wins
468+
mempty
469+
| mt == a_cd, n : _ <- d, Just ww <- ws !? fi n ->
463470
if W.currentTag s == W.tag ww then mempty else windows $ W.view (W.tag ww)
464471
| mt == a_cd ->
465472
trace $ "Bad _NET_CURRENT_DESKTOP with data=" ++ show d
@@ -473,8 +480,6 @@ ewmhDesktopsEventHook'
473480
if W.peek s == Just w then mempty else windows $ W.focusWindow w
474481
| mt == a_aw -> do
475482
if W.peek s == Just w then mempty else windows . appEndo =<< runQuery activateHook w
476-
| mt == a_cw ->
477-
killWindow w
478483
| otherwise ->
479484
-- The Message is unknown to us, but that is ok, not all are meant
480485
-- to be handled by the window manager

0 commit comments

Comments
 (0)