From d5d01308c2b2d9ae2a01307eee9333892bf958f2 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 20 Jun 2021 22:27:16 -0400 Subject: [PATCH] FIX client disconnets for signal matching --- lib/XMonad/Internal/DBus/Common.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/XMonad/Internal/DBus/Common.hs b/lib/XMonad/Internal/DBus/Common.hs index 855e56c..c7a5d02 100644 --- a/lib/XMonad/Internal/DBus/Common.hs +++ b/lib/XMonad/Internal/DBus/Common.hs @@ -20,6 +20,7 @@ callMethod mc = do -- TODO handle clienterrors here reply <- call client mc { methodCallDestination = Just "org.xmonad" } -- TODO not all methods warrent that we wait for a reply? + disconnect client return $ case reply of Left _ -> Nothing Right ret -> Just $ methodReturnBody ret @@ -28,6 +29,4 @@ callMethod mc = do addMatchCallback :: MatchRule -> ([Variant] -> IO ()) -> IO SignalHandler addMatchCallback rule cb = do client <- connectSession - s <- addMatch client rule $ cb . signalBody - disconnect client - return s + addMatch client rule $ cb . signalBody