diff options
author | Tomas Janousek <tomi@nomi.cz> | 2010-03-30 16:13:41 +0200 |
---|---|---|
committer | Tomas Janousek <tomi@nomi.cz> | 2010-03-30 16:13:41 +0200 |
commit | b71ef35f1a1a1d62d51a102496b6b73ece81d3d6 (patch) | |
tree | 374daf5ae59c023872dab9519ac33a1673f27598 /XMonad/Hooks | |
parent | 4143fc66b54bdc611a9e13cb46831817e1cbba96 (diff) | |
download | XMonadContrib-b71ef35f1a1a1d62d51a102496b6b73ece81d3d6.tar.gz XMonadContrib-b71ef35f1a1a1d62d51a102496b6b73ece81d3d6.tar.xz XMonadContrib-b71ef35f1a1a1d62d51a102496b6b73ece81d3d6.zip |
X.H.UrgencyHook: performance fix
Ignore-this: b626166259858f16bc5051c67b498c68
cleanupUrgents would update the Map in extensible state 2-times the number of
visible windows, resulting in excessive memory usage and garbage collection.
This seems to make it behave correctly.
darcs-hash:20100330141341-c9ff5-640ee7327b6818fd5a7560af8296056c9c9f3803.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r-- | XMonad/Hooks/UrgencyHook.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/XMonad/Hooks/UrgencyHook.hs b/XMonad/Hooks/UrgencyHook.hs index 7dcdf18..eb9173c 100644 --- a/XMonad/Hooks/UrgencyHook.hs +++ b/XMonad/Hooks/UrgencyHook.hs @@ -79,7 +79,7 @@ import XMonad.Util.Timer (TimerId, startTimer, handleTimer) import Control.Applicative ((<$>)) import Control.Monad (when) import Data.Bits (testBit) -import Data.List (delete) +import Data.List (delete, (\\)) import Data.Maybe (listToMaybe, maybeToList) import qualified Data.Set as S @@ -372,7 +372,9 @@ shouldSuppress :: SuppressWhen -> Window -> X Bool shouldSuppress sw w = elem w <$> suppressibleWindows sw cleanupUrgents :: SuppressWhen -> X () -cleanupUrgents sw = mapM_ clearUrgency =<< suppressibleWindows sw +cleanupUrgents sw = do + sw' <- suppressibleWindows sw + adjustUrgents (\\ sw') >> adjustReminders (filter $ ((`notElem` sw') . window)) suppressibleWindows :: SuppressWhen -> X [Window] suppressibleWindows Visible = gets $ S.toList . mapped |