Skip to content

Commit

Permalink
X.H.EwmhDesktops: Avoid some unnecessary refreshes
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.

Related: xmonad#371
  • Loading branch information
liskin committed Nov 5, 2020
1 parent adddfb4 commit 21d7e27
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions XMonad/Hooks/EwmhDesktops.hs
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,17 @@ ewmhDesktopsEventHook' EwmhConfig{ workspaceListTransform, activateHook }

if | mt == a_cd ->
case d of
(n:_) | 0 <= n && fi n < length ws -> windows $ W.view (W.tag (ws !! fi n))
| otherwise -> trace $ "Bad _NET_CURRENT_DESKTOP with data[0]="++show n
(n:_) | n < 0 || fi n >= length ws -> trace $ "Bad _NET_CURRENT_DESKTOP with data[0]="++show n
| W.currentTag s /= W.tag (ws !! fi n) -> windows $ W.view (W.tag (ws !! fi n))
| otherwise -> return ()
_ -> trace $ "Bad _NET_CURRENT_DESKTOP with data="++show d
| mt == a_d ->
case d of
(n:_) | 0 <= n && fi n < length ws -> windows $ W.shiftWin (W.tag (ws !! fi n)) w
| otherwise -> trace $ "Bad _NET_DESKTOP with data[0]="++show n
(n:_) | n < 0 || fi n >= length ws -> trace $ "Bad _NET_DESKTOP with data[0]="++show n
| W.findTag w s /= Just (W.tag (ws !! fi n)) -> windows $ W.shiftWin (W.tag (ws !! fi n)) w
| otherwise -> return ()
_ -> trace $ "Bad _NET_DESKTOP with data="++show d
| mt == a_aw -> do
| mt == a_aw && W.peek s /= Just w -> do
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
Expand Down

0 comments on commit 21d7e27

Please sign in to comment.