From 44036c0b92775668be30ce2cd6988a300af8d1d6 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Wed, 4 Nov 2020 18:56:47 +0000 Subject: [PATCH] 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: https://github.com/xmonad/xmonad-contrib/issues/396 --- XMonad/Hooks/EwmhDesktops.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index d2744a30e8..8c431c1409 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -271,9 +271,14 @@ handle f (ClientMessageEvent {ev_window = w, ev_message_type = mt, ev_data = d}) | otherwise -> trace $ "Bad _NET_DESKTOP with data[0]="++show n _ -> trace $ "Bad _NET_DESKTOP with data="++show d | mt == a_aw -> do - lh <- asks (logHook . config) - XS.put (NetActivated (Just w)) - lh + case d of + -- when the request comes from a pager, honor it unconditionally + -- https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#sourceindication + (2:_) -> windows $ W.focusWindow w + _ -> do + lh <- asks (logHook . config) + XS.put (NetActivated (Just w)) + lh | mt == a_cw -> killWindow w | otherwise ->