From 4fe99635e87c4f2262a27bf91c1ab6c7e3ee0988 Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Wed, 31 Aug 2011 13:39:01 +0200 Subject: Working version The last commit removed the exposure event which turned out to be a big problem. Although the bug still exists that not all xrandr events are received when normal events are enabled. To work around this problem a second display is created on which only the xrandr events are enabled. On an exposure event the eventqueue for this display is processed. The results are very good, in the worst case an exposure event must be triggered by the user on xmobar to update its position. --- src/Main.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 18e05e2..941a844 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -42,6 +42,7 @@ import Control.Monad (unless) main :: IO () main = do d <- openDisplay "" + d' <- openDisplay "" args <- getArgs (o,file) <- getOpts args (c,defaultings) <- case file of @@ -60,7 +61,8 @@ main = do cls <- mapM (parseTemplate conf) (splitTemplate conf) vars <- mapM (mapM startCommand) cls (r,w) <- createWin d fs conf - eventLoop (XConf d r w fs conf) vars + _ <- enableXRandrEventListen d' + eventLoop (XConf d d' r w fs conf) vars -- | Splits the template in its parts splitTemplate :: Config -> [String] -- cgit v1.2.3