diff options
-rw-r--r-- | lib/Phi/X11.hs | 12 |
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 |