aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--XMonad.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/XMonad.hs b/XMonad.hs
index 4cc4607..cf72908 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -18,7 +18,7 @@
module XMonad (
X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), LayoutClass(..), Layout(..), ReadableLayout(..),
Typeable, Message, SomeMessage(..), fromMessage, runLayout,
- runX, catchX, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX,
+ runX, catchX, userCode, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX,
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW
) where
@@ -95,6 +95,11 @@ catchX (X job) (X errcase) = do
put s'
return a
+-- | Execute the argument, catching all exceptions. Either this function or
+-- catchX should be used at all callsites of user customized code.
+userCode :: X () -> X ()
+userCode a = catchX a (return ())
+
-- ---------------------------------------------------------------------
-- Convenient wrappers to state