diff options
author | Devin Mullins <me@twifkak.com> | 2008-09-20 08:21:17 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2008-09-20 08:21:17 +0200 |
commit | 72aabf5aed11319b2e1413fd1bb1246fcc1e754c (patch) | |
tree | 17383dfa6de0a7ac7547f3f60c1ecc4be3e44727 /XMonad/Hooks | |
parent | faabea241a4df52a360255f76ce70bf8014eebdb (diff) | |
download | XMonadContrib-72aabf5aed11319b2e1413fd1bb1246fcc1e754c.tar.gz XMonadContrib-72aabf5aed11319b2e1413fd1bb1246fcc1e754c.tar.xz XMonadContrib-72aabf5aed11319b2e1413fd1bb1246fcc1e754c.zip |
UrgencyHook bug fix: cleanupUrgents should clean up reminders, too
darcs-hash:20080920062117-78224-2d5e96e00a63d20c8957f4cd1e2850ca207112b8.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r-- | XMonad/Hooks/UrgencyHook.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/XMonad/Hooks/UrgencyHook.hs b/XMonad/Hooks/UrgencyHook.hs index 726589c..fef44fe 100644 --- a/XMonad/Hooks/UrgencyHook.hs +++ b/XMonad/Hooks/UrgencyHook.hs @@ -79,7 +79,7 @@ import Control.Applicative ((<$>)) import Control.Monad (when) import Data.Bits (testBit) import Data.IORef -import Data.List ((\\), delete) +import Data.List (delete) import Data.Maybe (listToMaybe, maybeToList) import qualified Data.Set as S import Foreign (unsafePerformIO) @@ -304,6 +304,9 @@ readReminders = io $ readIORef reminders adjustReminders :: ([Reminder] -> [Reminder]) -> X () adjustReminders f = io $ modifyIORef reminders f +clearUrgency :: Window -> X () +clearUrgency w = adjustUrgents (delete w) >> adjustReminders (filter $ (w /=) . window) + data WithUrgencyHook h = WithUrgencyHook h UrgencyConfig deriving (Read, Show) @@ -334,8 +337,7 @@ instance UrgencyHook h => EventHook (WithUrgencyHook h) where clearUrgency w _ -> mapM_ handleReminder =<< readReminders - where clearUrgency w = adjustUrgents (delete w) >> adjustReminders (filter $ (w /=) . window) - handleReminder reminder = handleTimer (timer reminder) event $ reminderHook wuh reminder + where handleReminder reminder = handleTimer (timer reminder) event $ reminderHook wuh reminder callUrgencyHook :: UrgencyHook h => WithUrgencyHook h -> Window -> X () callUrgencyHook (WithUrgencyHook hook UrgencyConfig { suppressWhen = sw, remindWhen = rw }) w = @@ -367,9 +369,7 @@ shouldSuppress :: SuppressWhen -> Window -> X Bool shouldSuppress sw w = elem w <$> suppressibleWindows sw cleanupUrgents :: SuppressWhen -> X () -cleanupUrgents sw = do - suppressibles <- suppressibleWindows sw - adjustUrgents (\\ suppressibles) +cleanupUrgents sw = mapM_ clearUrgency =<< suppressibleWindows sw suppressibleWindows :: SuppressWhen -> X [Window] suppressibleWindows Visible = gets $ S.toList . mapped |