From d468b353b8004e74be115bc8ddd65f936ce2dc86 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 22 Jan 2009 01:26:43 +0100 Subject: Add uninstallSignalHandlers, use in spawn Ignore-this: d91bde6f965341a2619fe2dde83cc099 darcs-hash:20090122002643-25a6b-7aea3d61d968ccdec5ad304043910bd30120aabe --- XMonad/Core.hs | 10 ++++++++-- 1 file 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 () -- cgit v1.2.3