Skip to content

Commit

Permalink
X.H.EwmhDesktops: Avoid some unnecessary refreshes (border flicker)
Browse files Browse the repository at this point in the history
Current version of Steam sends _NET_ACTIVE_WINDOW ClientMessage for
every mouse click which results in a lot of border blinking.

Ignore requests that would result in no change to get rid of the
annoying border flicker that is inevitable with the current
implementation of XMonad.Operations.windows.

(Note that Steam also sends ConfigureRequest events, and these cause
an additional refresh due to the call to `float` when handling the event
in xmonad core. Not sure if worth fixing.)

Related: #371
Related: #399
  • Loading branch information
liskin committed May 21, 2021
1 parent 2fb4357 commit ebe2a62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions XMonad/Hooks/EwmhDesktops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,18 @@ handle f ClientMessageEvent{ev_window = w, ev_message_type = mt, ev_data = d} =
a_cw <- getAtom "_NET_CLOSE_WINDOW"

if | mt == a_cd, n : _ <- d, Just ww <- ws !? fi n ->
windows $ W.view (W.tag ww)
if W.currentTag s == W.tag ww then mempty else windows $ W.view (W.tag ww)
| mt == a_cd ->
trace $ "Bad _NET_CURRENT_DESKTOP with data=" ++ show d
| mt == a_d, n : _ <- d, Just ww <- ws !? fi n ->
windows $ W.shiftWin (W.tag ww) w
if W.findTag w s == Just (W.tag ww) then mempty else windows $ W.shiftWin (W.tag ww) w
| mt == a_d ->
trace $ "Bad _NET_WM_DESKTOP with data=" ++ show d
| mt == a_aw, 2 : _ <- d ->
-- when the request comes from a pager, honor it unconditionally
-- https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#sourceindication
windows $ W.focusWindow w
| mt == a_aw -> do
| mt == a_aw, W.peek s /= Just w -> do
lh <- asks (logHook . config)
XS.put (NetActivated (Just w))
lh
Expand Down

0 comments on commit ebe2a62

Please sign in to comment.