aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks/UrgencyHook.hs
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2010-03-30 16:13:41 +0200
committerTomas Janousek <tomi@nomi.cz>2010-03-30 16:13:41 +0200
commitb71ef35f1a1a1d62d51a102496b6b73ece81d3d6 (patch)
tree374daf5ae59c023872dab9519ac33a1673f27598 /XMonad/Hooks/UrgencyHook.hs
parent4143fc66b54bdc611a9e13cb46831817e1cbba96 (diff)
downloadXMonadContrib-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 '')
-rw-r--r--XMonad/Hooks/UrgencyHook.hs6
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