From f98c59dde19d47435837561cd199b5a773b6bf67 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sun, 27 May 2007 09:21:06 +0200 Subject: clean Main.hs slightly darcs-hash:20070527072106-9c5c1-48830bdd83fd4823fdabce0961dafb3bea416bf6 --- Main.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index c2124e9..c1a8b48 100644 --- a/Main.hs +++ b/Main.hs @@ -80,6 +80,7 @@ main = do mapM_ manage ws -- main loop, for all you HOF/recursion fans out there. forever $ handle =<< io (nextEvent dpy e >> getEvent e) + where forever a = a >> forever a -- --------------------------------------------------------------------- @@ -91,10 +92,10 @@ scan :: Display -> Window -> IO [Window] scan dpy rootw = do (_, _, ws) <- queryTree dpy rootw filterM ok ws - where - ok w = do wa <- getWindowAttributes dpy w - return $ not (wa_override_redirect wa) - && wa_map_state wa == waIsViewable + + where ok w = do wa <- getWindowAttributes dpy w + return $ not (wa_override_redirect wa) + && wa_map_state wa == waIsViewable -- | Grab the keys back grabKeys :: Display -> Window -> IO () @@ -106,8 +107,8 @@ grabKeys dpy rootw = do -- XKeysymToKeycode() returns zero." when (kc /= '\0') $ mapM_ (grab kc . (mask .|.)) $ [0, numlockMask, lockMask, numlockMask .|. lockMask] - where - grab kc m = grabKey dpy kc m rootw True grabModeAsync grabModeAsync + + where grab kc m = grabKey dpy kc m rootw True grabModeAsync grabModeAsync -- --------------------------------------------------------------------- -- | Event handler. Map X events onto calls into Operations.hs, which -- cgit v1.2.3