aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevin Mullins <me@twifkak.com>2007-11-03 16:03:58 +0100
committerDevin Mullins <me@twifkak.com>2007-11-03 16:03:58 +0100
commitd8cc1c74d7c0342a6fcb4fb53f1681c059c3d5cc (patch)
tree942b1536d26773f3458f7d55c41c4bed224fe5ff
parent7932b8d34f317567c3fef9a7cc0c987daf5cc40a (diff)
downloadXMonadContrib-d8cc1c74d7c0342a6fcb4fb53f1681c059c3d5cc.tar.gz
XMonadContrib-d8cc1c74d7c0342a6fcb4fb53f1681c059c3d5cc.tar.xz
XMonadContrib-d8cc1c74d7c0342a6fcb4fb53f1681c059c3d5cc.zip
clean up destroyed windows from urgents list
darcs-hash:20071103150358-78224-3ebb06a664f46b5277cd9fb84b76820a45eb0cc2.gz
-rw-r--r--UrgencyHook.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/UrgencyHook.hs b/UrgencyHook.hs
index e22ee75..8f59af8 100644
--- a/UrgencyHook.hs
+++ b/UrgencyHook.hs
@@ -35,7 +35,7 @@ import Control.Monad (when)
import Control.Monad.State (gets)
import Data.Bits (testBit, clearBit)
import Data.IORef
-import Data.List ((\\))
+import Data.List ((\\), delete)
import Data.Maybe (listToMaybe)
import qualified Data.Set as S
import Graphics.X11.Xlib
@@ -97,7 +97,7 @@ data WithUrgencyHook a = WithUrgencyHook deriving (Read, Show)
instance LayoutModifier WithUrgencyHook Window where
handleMess _ mess
- | Just (PropertyEvent { ev_event_type = t, ev_atom = a, ev_window = w }) <- fromMessage mess = do
+ | Just PropertyEvent { ev_event_type = t, ev_atom = a, ev_window = w } <- fromMessage mess = do
when (t == propertyNotify && a == wM_HINTS) $ withDisplay $ \dpy -> do
wmh@WMHints { wmh_flags = flags } <- io $ getWMHints dpy w
when (testBit flags urgencyHintBit) $ do
@@ -115,6 +115,9 @@ instance LayoutModifier WithUrgencyHook Window where
-- effect of ignoring *all* urgency-clearing messages, some of which might
-- be legitimate. Let's wait for bug reports on that, though.
return Nothing
+ | Just DestroyWindowEvent {ev_window = w} <- fromMessage mess = do
+ adjustUrgents (delete w)
+ return Nothing
| otherwise =
return Nothing