summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <spencerjanssen@gmail.com>2009-01-22 01:26:43 +0100
committerSpencer Janssen <spencerjanssen@gmail.com>2009-01-22 01:26:43 +0100
commitd468b353b8004e74be115bc8ddd65f936ce2dc86 (patch)
treec2ce9cd7744393e6de528f32dff14d73262212ab /XMonad
parentfd327b484fe78402c83bc2e61bad885119aa1790 (diff)
downloadmetatile-d468b353b8004e74be115bc8ddd65f936ce2dc86.tar
metatile-d468b353b8004e74be115bc8ddd65f936ce2dc86.zip
Add uninstallSignalHandlers, use in spawn
Ignore-this: d91bde6f965341a2619fe2dde83cc099 darcs-hash:20090122002643-25a6b-7aea3d61d968ccdec5ad304043910bd30120aabe
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Core.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index e0afcda..e36e165 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -24,7 +24,7 @@ module XMonad.Core (
XConf(..), XConfig(..), LayoutClass(..),
Layout(..), readsLayout, Typeable, Message,
SomeMessage(..), fromMessage, LayoutMessages(..),
- runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers,
+ runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers,
withDisplay, withWindowSet, isRoot, runOnWorkspaces,
getAtom, spawn, spawnPID, getXMonadDir, recompile, trace, whenJust, whenX,
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, ManageHook, Query(..), runQuery
@@ -358,6 +358,7 @@ spawn x = spawnPID x >> return ()
-- | Like 'spawn', but returns the 'ProcessID' of the launched application
spawnPID :: MonadIO m => String -> m ProcessID
spawnPID x = io . forkProcess . finally nullStdin $ do
+ uninstallSignalHandlers
createSession
executeFile "/bin/sh" False ["-c", x] Nothing
where
@@ -410,7 +411,7 @@ recompile force = io $ do
if (force || srcT > binT)
then do
-- temporarily disable SIGCHLD ignoring:
- installHandler sigCHLD Default Nothing
+ uninstallSignalHandlers
status <- bracket (openFile err WriteMode) hClose $ \h -> do
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
Nothing Nothing Nothing (Just h)
@@ -456,3 +457,8 @@ installSignalHandlers = io $ do
x <- getAnyProcessStatus False False
when (isJust x) more
return ()
+
+uninstallSignalHandlers :: MonadIO m => m ()
+uninstallSignalHandlers = io $ do
+ installHandler sigCHLD Default Nothing
+ return ()