aboutsummaryrefslogtreecommitdiffstats
path: root/Main.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-09 14:41:49 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-09 14:41:49 +0100
commiteb741c1887cc5997150bffa5b722fbc14237be5e (patch)
tree7ae44d838244c45c7ccd4a8b583bf2e1dfe20ab8 /Main.hs
parentdc553eeec4a7cfdac2e97811302b9abdda4e3638 (diff)
downloadxmonad-eb741c1887cc5997150bffa5b722fbc14237be5e.tar.gz
xmonad-eb741c1887cc5997150bffa5b722fbc14237be5e.tar.xz
xmonad-eb741c1887cc5997150bffa5b722fbc14237be5e.zip
alloc the event space only once
darcs-hash:20070309134149-9c5c1-34d0f84463d4f1a35e9769398c98025ab7d140fa.gz
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Main.hs b/Main.hs
index 24f7b89..edade6f 100644
--- a/Main.hs
+++ b/Main.hs
@@ -67,14 +67,15 @@ main = do
, workspace = W.empty workspaces
}
- runW initState $ do
+ allocaXEvent $ \ev ->
+ runW initState $ do
r <- io $ rootWindow dpy dflt
- io $ do selectInput dpy r $ substructureRedirectMask
- .|. substructureNotifyMask
- .|. enterWindowMask
- .|. leaveWindowMask
+ io $ sync dpy False
+ io $ selectInput dpy r $ substructureRedirectMask
+ .|. substructureNotifyMask
+ .|. enterWindowMask
+ .|. leaveWindowMask
- sync dpy False
grabKeys dpy r
(_, _, ws) <- io $ queryTree dpy r
@@ -84,8 +85,9 @@ main = do
when (not (waOverrideRedirect wa) && waMapState wa == waIsViewable)
(manage w)
- forever $ handle =<< io (allocaXEvent $ \ev ->
- nextEvent dpy ev >> getEvent ev)
+ io $ sync dpy False
+ forever $ handle =<< io (nextEvent dpy ev >> getEvent ev)
+
return ()
where
forever a = a >> forever a