mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-01 12:41:53 -07:00
Add uninstallSignalHandlers, use in spawn
This commit is contained in:
@@ -24,7 +24,7 @@ module XMonad.Core (
|
|||||||
XConf(..), XConfig(..), LayoutClass(..),
|
XConf(..), XConfig(..), LayoutClass(..),
|
||||||
Layout(..), readsLayout, Typeable, Message,
|
Layout(..), readsLayout, Typeable, Message,
|
||||||
SomeMessage(..), fromMessage, LayoutMessages(..),
|
SomeMessage(..), fromMessage, LayoutMessages(..),
|
||||||
runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers,
|
runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers,
|
||||||
withDisplay, withWindowSet, isRoot, runOnWorkspaces,
|
withDisplay, withWindowSet, isRoot, runOnWorkspaces,
|
||||||
getAtom, spawn, spawnPID, getXMonadDir, recompile, trace, whenJust, whenX,
|
getAtom, spawn, spawnPID, getXMonadDir, recompile, trace, whenJust, whenX,
|
||||||
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, ManageHook, Query(..), runQuery
|
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
|
-- | Like 'spawn', but returns the 'ProcessID' of the launched application
|
||||||
spawnPID :: MonadIO m => String -> m ProcessID
|
spawnPID :: MonadIO m => String -> m ProcessID
|
||||||
spawnPID x = io . forkProcess . finally nullStdin $ do
|
spawnPID x = io . forkProcess . finally nullStdin $ do
|
||||||
|
uninstallSignalHandlers
|
||||||
createSession
|
createSession
|
||||||
executeFile "/bin/sh" False ["-c", x] Nothing
|
executeFile "/bin/sh" False ["-c", x] Nothing
|
||||||
where
|
where
|
||||||
@@ -410,7 +411,7 @@ recompile force = io $ do
|
|||||||
if (force || srcT > binT)
|
if (force || srcT > binT)
|
||||||
then do
|
then do
|
||||||
-- temporarily disable SIGCHLD ignoring:
|
-- temporarily disable SIGCHLD ignoring:
|
||||||
installHandler sigCHLD Default Nothing
|
uninstallSignalHandlers
|
||||||
status <- bracket (openFile err WriteMode) hClose $ \h -> do
|
status <- bracket (openFile err WriteMode) hClose $ \h -> do
|
||||||
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
|
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
|
||||||
Nothing Nothing Nothing (Just h)
|
Nothing Nothing Nothing (Just h)
|
||||||
@@ -456,3 +457,8 @@ installSignalHandlers = io $ do
|
|||||||
x <- getAnyProcessStatus False False
|
x <- getAnyProcessStatus False False
|
||||||
when (isJust x) more
|
when (isJust x) more
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
uninstallSignalHandlers :: MonadIO m => m ()
|
||||||
|
uninstallSignalHandlers = io $ do
|
||||||
|
installHandler sigCHLD Default Nothing
|
||||||
|
return ()
|
||||||
|
Reference in New Issue
Block a user