From aadf8d978032db0305045d3cf9f2ef08cdec6197 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 7 Sep 2011 22:33:07 +0200 Subject: Add a short delay waiting for messages before starting rendering --- lib/Phi/X11.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/Phi/X11.hs b/lib/Phi/X11.hs index c66fa54..a4fd5c1 100644 --- a/lib/Phi/X11.hs +++ b/lib/Phi/X11.hs @@ -143,11 +143,13 @@ runPhi xconfig config widget = do forever $ do available <- messageAvailable phi - unless available $ do - repaint <- gets phiRepaint - when repaint $ do - updatePanels conn xcb - modify $ \state -> state {phiRepaint = False} + repaint <- gets phiRepaint + when (not available && repaint) $ liftIO $ threadDelay 30000 + + available <- messageAvailable phi + when (not available && repaint) $ do + updatePanels conn xcb + modify $ \state -> state {phiRepaint = False} message <- receiveMessage phi handleMessage conn xcb message -- cgit v1.2.3