From 73333df333f0c858ac445d518f93bffe4e8d64c6 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Mon, 4 Jun 2007 05:56:37 +0200 Subject: clean up Main.hs slightly darcs-hash:20070604035637-9c5c1-a5be67b987c402fe384f7a3c5c3443aabdf62885 --- Main.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 04591ae..1575fa5 100644 --- a/Main.hs +++ b/Main.hs @@ -157,14 +157,13 @@ handle e@(MappingNotifyEvent {ev_window = w}) = do when (ev_request e == mappingKeyboard) $ withDisplay $ io . flip grabKeys w -- click on an unfocused window, makes it focused on this workspace -handle (ButtonEvent { ev_window = w, ev_subwindow = subw, ev_event_type = t, ev_state = m, ev_button = b }) - | t == buttonPress = do isr <- isRoot w - -- If it's the root window, then it's something we - -- grabbed in grabButtons. Otherwise, it's - -- click-to-focus. - if isr - then whenJust (M.lookup (cleanMask m, b) mouseBindings) ($ subw) - else focus w +handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b }) + | t == buttonPress = do + isr <- isRoot w + if isr then whenJust (M.lookup (cleanMask (ev_state e), b) mouseBindings) ($ ev_subwindow e) + else focus w + -- If it's the root window, then it's something we + -- grabbed in grabButtons. Otherwise, it's click-to-focus. -- entered a normal window, makes this focused. handle e@(CrossingEvent {ev_window = w, ev_event_type = t}) @@ -195,7 +194,8 @@ handle e@(ConfigureRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do else io $ allocaXEvent $ \ev -> do setEventType ev configureNotify setConfigureEvent ev w w - (wa_x wa) (wa_y wa) (wa_width wa) (wa_height wa) (ev_border_width e) none (wa_override_redirect wa) + (wa_x wa) (wa_y wa) (wa_width wa) + (wa_height wa) (ev_border_width e) none (wa_override_redirect wa) sendEvent dpy w False 0 ev io $ sync dpy False -- cgit v1.2.3