From 1dc38bd9200da27719e7f6c7f86bbcf066c97127 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sun, 10 Jun 2007 22:34:51 +0200 Subject: make Decoration set the input mask appropriately. darcs-hash:20070610203451-72aca-e8115141402639befdd45f2903091c6f56a48582.gz --- Decoration.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Decoration.hs b/Decoration.hs index 1b3eea9..d7ec930 100644 --- a/Decoration.hs +++ b/Decoration.hs @@ -1,6 +1,7 @@ module XMonadContrib.Decoration ( newDecoration ) where import qualified Data.Map as M +import Data.Bits ( (.|.) ) import Control.Monad.Reader ( asks ) import Control.Monad.State ( modify, gets ) import Graphics.X11.Xlib @@ -18,6 +19,7 @@ newDecoration (Rectangle x y w h) th fg bg draw click = n <- (W.tag . W.workspace . W.current) `fmap` gets windowset Just (l,ls) <- M.lookup n `fmap` gets layouts win <- io $ createSimpleWindow d rt x y w h (fromIntegral th) fg bg + io $ selectInput d win $ exposureMask .|. buttonPressMask io $ mapWindow d win let draw' = withGC win draw modml :: (SomeMessage -> X (Maybe Layout)) -> SomeMessage -> X (Maybe Layout) @@ -30,9 +32,9 @@ newDecoration (Rectangle x y w h) th fg bg draw click = | t == buttonPress && thisw == win = click handle_event (ButtonEvent {ev_window = thisw,ev_event_type = t}) | t == buttonPress && thisw == win = click - handle_event (AnyEvent {ev_window = thisw}) | thisw == win = draw' + handle_event (AnyEvent {ev_window = thisw, ev_event_type = t}) + | thisw == win && t == expose = draw' handle_event _ = return () - draw' modify $ \s -> s { layouts = M.insert n (modl l,ls) (layouts s) } return win -- cgit v1.2.3