summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-06-04 05:56:37 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-06-04 05:56:37 +0200
commit73333df333f0c858ac445d518f93bffe4e8d64c6 (patch)
treefa25563a00182abee8c050b67fbc60302907a942
parent0e80840ef35bcedae1ac11f32a4ffeaed13c0119 (diff)
downloadmetatile-73333df333f0c858ac445d518f93bffe4e8d64c6.tar
metatile-73333df333f0c858ac445d518f93bffe4e8d64c6.zip
clean up Main.hs slightly
darcs-hash:20070604035637-9c5c1-a5be67b987c402fe384f7a3c5c3443aabdf62885
-rw-r--r--Main.hs18
1 files changed, 9 insertions, 9 deletions
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