aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-10 22:34:51 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-10 22:34:51 +0200
commit1dc38bd9200da27719e7f6c7f86bbcf066c97127 (patch)
tree2bdd1021f25d76dc70ff200a16543600ac828f99
parentc55dea78d8cd2c748b35607966ffbb2625003fce (diff)
downloadXMonadContrib-1dc38bd9200da27719e7f6c7f86bbcf066c97127.tar.gz
XMonadContrib-1dc38bd9200da27719e7f6c7f86bbcf066c97127.tar.xz
XMonadContrib-1dc38bd9200da27719e7f6c7f86bbcf066c97127.zip
make Decoration set the input mask appropriately.
darcs-hash:20070610203451-72aca-e8115141402639befdd45f2903091c6f56a48582.gz
-rw-r--r--Decoration.hs6
1 files 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