diff options
author | David Roundy <droundy@darcs.net> | 2007-10-12 03:33:05 +0200 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2007-10-12 03:33:05 +0200 |
commit | d4a3b83436bcc22be93b8084a52a898b952ee94f (patch) | |
tree | b6d41c396f2011264466f9f77652ea6c6fbd269e /Main.hs | |
parent | 89999a17244708953e0fcfe8a64161ef1d064f19 (diff) | |
download | metatile-d4a3b83436bcc22be93b8084a52a898b952ee94f.tar metatile-d4a3b83436bcc22be93b8084a52a898b952ee94f.zip |
catch exceptions when calling user-written code.
This is a minimal approach that only catches error
in actual user-written code.
darcs-hash:20071012013305-72aca-ab7d36fa77fb3c4fda4abbc7421ba7ba13d9b21a
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -165,6 +165,7 @@ handle (KeyEvent {ev_event_type = t, ev_state = m, ev_keycode = code}) | t == keyPress = withDisplay $ \dpy -> do s <- io $ keycodeToKeysym dpy code 0 whenJust (M.lookup (cleanMask m,s) keys) id + `catchX` return () -- manage a new window handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do @@ -213,6 +214,7 @@ handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b }) -- grabbed in grabButtons. Otherwise, it's click-to-focus. isr <- isRoot w if isr then whenJust (M.lookup (cleanMask (ev_state e), b) mouseBindings) ($ ev_subwindow e) + `catchX` return () else focus w sendMessage e -- Always send button events. |