Skip to content

Commit 2666d46

Browse files
liskinTheMC47
authored andcommitted
X.H.EwmhDesktops: Fix _NET_ACTIVE_WINDOW requests from pagers being ignored
This makes window switching apps like rofi and alttab able to activate windows even if the logHook doesn't activate them (which it doesn't by default, and that's a regression). Related: xmonad#396 Related: xmonad#110
1 parent 506fe04 commit 2666d46

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
@@ -272,9 +272,14 @@ handle f (ClientMessageEvent {ev_window = w, ev_message_type = mt, ev_data = d})
272272
| otherwise -> trace $ "Bad _NET_DESKTOP with data[0]="++show n
273273
_ -> trace $ "Bad _NET_DESKTOP with data="++show d
274274
| mt == a_aw -> do
275-
lh <- asks (logHook . config)
276-
XS.put (NetActivated (Just w))
277-
lh
275+
case d of
276+
-- when the request comes from a pager, honor it unconditionally
277+
-- https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#sourceindication
278+
(2:_) -> windows $ W.focusWindow w
279+
_ -> do
280+
lh <- asks (logHook . config)
281+
XS.put (NetActivated (Just w))
282+
lh
278283
| mt == a_cw ->
279284
killWindow w
280285
| otherwise ->

0 commit comments

Comments
 (0)