summaryrefslogtreecommitdiffstats
path: root/lib/Phi
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-09-07 22:33:07 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-09-07 22:33:07 +0200
commitaadf8d978032db0305045d3cf9f2ef08cdec6197 (patch)
treeb41cac4b55297d00e1b8498bd9c83cc9f4bb4f70 /lib/Phi
parent6746d60e3f23a2abe4abe8bb0d26821b8faef8bd (diff)
downloadphi-aadf8d978032db0305045d3cf9f2ef08cdec6197.tar
phi-aadf8d978032db0305045d3cf9f2ef08cdec6197.zip
Add a short delay waiting for messages before starting rendering
Diffstat (limited to 'lib/Phi')
-rw-r--r--lib/Phi/X11.hs12
1 files 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