Skip to content

Commit

Permalink
X.H.ManageDocks: Fix button events on decoration windows
Browse files Browse the repository at this point in the history
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: xmonad#517
Fixes: ec14617 ("X.H.ManageDocks: React to strut updates of override_redirect docks")
Related: xmonad/X11#77
  • Loading branch information
liskin committed Jun 1, 2021
1 parent 1427c94 commit 56cf96c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XMonad/Hooks/ManageDocks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56cf96c

Please sign in to comment.