FIX actually the dbus client disconnect problem
This commit is contained in:
parent
841bf0b5c8
commit
d9b1886db6
|
@ -110,9 +110,7 @@ withDBusClientConnection cb n logfile f =
|
||||||
logOpts <- setLogVerboseFormat True . setLogUseTime True <$> logOptionsHandle h False
|
logOpts <- setLogVerboseFormat True . setLogUseTime True <$> logOptionsHandle h False
|
||||||
withLogFunc logOpts $ \lf -> do
|
withLogFunc logOpts $ \lf -> do
|
||||||
env <- mkSimpleApp lf Nothing
|
env <- mkSimpleApp lf Nothing
|
||||||
runRIO env $
|
runRIO env $ displayMaybe' cb f =<< getDBusClient n
|
||||||
bracket (getDBusClient n) (mapM (liftIO . disconnect . ncClient)) $
|
|
||||||
displayMaybe' cb f
|
|
||||||
|
|
||||||
-- | Run a plugin action with a new DBus client and logfile path.
|
-- | Run a plugin action with a new DBus client and logfile path.
|
||||||
-- This is necessary for DBus callbacks which run in separate threads, which
|
-- This is necessary for DBus callbacks which run in separate threads, which
|
||||||
|
@ -128,4 +126,9 @@ withNestedDBusClientConnection n logfile f = do
|
||||||
dpy <- asks plugDisplay
|
dpy <- asks plugDisplay
|
||||||
s <- asks plugState
|
s <- asks plugState
|
||||||
cb <- asks plugCallback
|
cb <- asks plugCallback
|
||||||
withDBusClientConnection cb n logfile $ \c -> mapRIO (PluginEnv c s dpy cb) f
|
let run h = do
|
||||||
|
logOpts <- setLogVerboseFormat True . setLogUseTime True <$> logOptionsHandle h False
|
||||||
|
withLogFunc logOpts $ \lf -> do
|
||||||
|
env <- mkSimpleApp lf Nothing
|
||||||
|
runRIO env $ withDBusClient_ n $ \cl -> mapRIO (PluginEnv cl s dpy cb) f
|
||||||
|
maybe (run stderr) (`withLogFile` run) logfile
|
||||||
|
|
Loading…
Reference in New Issue