diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-12 03:42:17 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-12 03:42:17 +0200 |
commit | 2075209956b31a2aeac4acacc2d49c3d963b9d15 (patch) | |
tree | 8f21050abd58a0c407b0253aa9bff3115dec2c8d /Main.hs | |
parent | a7cbcbd85bc6153b87318b78c64a28488350001a (diff) | |
download | xmonad-2075209956b31a2aeac4acacc2d49c3d963b9d15.tar.gz xmonad-2075209956b31a2aeac4acacc2d49c3d963b9d15.tar.xz xmonad-2075209956b31a2aeac4acacc2d49c3d963b9d15.zip |
Add userCode function for the popular m `catchX` return ()
darcs-hash:20071012014217-a5988-06b6f1519b5f87fcbc8220ad5bd69181c721635a.gz
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -164,8 +164,7 @@ handle :: Event -> X () 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 () + userCode $ whenJust (M.lookup (cleanMask m,s) keys) id -- manage a new window handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do @@ -213,8 +212,7 @@ handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b }) -- If it's the root window, then it's something we -- 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 () + if isr then userCode $ whenJust (M.lookup (cleanMask (ev_state e), b) mouseBindings) ($ ev_subwindow e) else focus w sendMessage e -- Always send button events. @@ -258,6 +256,6 @@ handle (ConfigureEvent {ev_window = w}) = whenX (isRoot w) rescreen -- property notify handle PropertyEvent { ev_event_type = t, ev_atom = a } - | t == propertyNotify && a == wM_NAME = logHook `catchX` return () + | t == propertyNotify && a == wM_NAME = userCode logHook handle e = broadcastMessage e -- trace (eventName e) -- ignoring |