From 56cf96cfa9b1d69b7bd824e572500fde9f0acca2 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Fri, 14 May 2021 18:32:45 +0100 Subject: [PATCH] X.H.ManageDocks: Fix button events on decoration windows Decoration windows are created using XMonad.Util.XUtils.createNewWindow which happens to set _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_DESKTOP, and ManageDocks considers such windows candidates for struts and therefore requests property events, thus overriding the original event mask requested by decorations. The fix is to first obtain the current event mask, set the required bits in it only then reset the mask. Fixes: https://github.com/xmonad/xmonad-contrib/issues/517 Fixes: ec146171238b ("X.H.ManageDocks: React to strut updates of override_redirect docks") Related: https://github.com/xmonad/X11/pull/77 --- XMonad/Hooks/ManageDocks.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XMonad/Hooks/ManageDocks.hs b/XMonad/Hooks/ManageDocks.hs index 41ddf44c..74ee0e1b 100644 --- a/XMonad/Hooks/ManageDocks.hs +++ b/XMonad/Hooks/ManageDocks.hs @@ -142,7 +142,8 @@ manageDocks = checkDock --> (doIgnore <+> doRequestDockEvents) -- (Only if not already a client to avoid overriding 'clientMask') requestDockEvents :: Window -> X () requestDockEvents w = whenX (not <$> isClient w) $ withDisplay $ \dpy -> - io $ selectInput dpy w (propertyChangeMask .|. structureNotifyMask) + withWindowAttributes dpy w $ \attrs -> io $ selectInput dpy w $ + wa_your_event_mask attrs .|. propertyChangeMask .|. structureNotifyMask -- | Checks if a window is a DOCK or DESKTOP window checkDock :: Query Bool