Fix background update race, speed up rendering!
This commit is contained in:
parent
906dc08d3e
commit
de1dc32b33
1 changed files with 28 additions and 18 deletions
|
@ -208,8 +208,9 @@ updatePanels dispvar = do
|
||||||
let screen = defaultScreen disp
|
let screen = defaultScreen disp
|
||||||
visual = defaultVisual disp screen
|
visual = defaultVisual disp screen
|
||||||
|
|
||||||
buffer <- liftIO $ withDimension area $ Util.createXlibSurface disp pixmap visual
|
xbuffer <- liftIO $ withDimension area $ Util.createXlibSurface disp pixmap visual
|
||||||
|
|
||||||
|
liftIO $ (withDimension area $ withSimilarSurface xbuffer ContentColor) $ \buffer -> do
|
||||||
renderWith buffer $ do
|
renderWith buffer $ do
|
||||||
withPatternForSurface rootImage $ \pattern -> do
|
withPatternForSurface rootImage $ \pattern -> do
|
||||||
save
|
save
|
||||||
|
@ -218,8 +219,12 @@ updatePanels dispvar = do
|
||||||
paint
|
paint
|
||||||
restore
|
restore
|
||||||
Widget.renderWidgets layoutedWidgets $ panelScreenArea panel
|
Widget.renderWidgets layoutedWidgets $ panelScreenArea panel
|
||||||
|
renderWith xbuffer $ do
|
||||||
|
withPatternForSurface buffer $ \pattern -> do
|
||||||
|
setSource pattern
|
||||||
|
paint
|
||||||
|
|
||||||
surfaceFinish buffer
|
surfaceFinish xbuffer
|
||||||
|
|
||||||
-- copy buffer to window
|
-- copy buffer to window
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
|
@ -266,7 +271,12 @@ updateRootImage disp = do
|
||||||
|
|
||||||
bg <- gets phiRootImage
|
bg <- gets phiRootImage
|
||||||
|
|
||||||
when (pixmap /= 0) $ do
|
case pixmap of
|
||||||
|
0 -> do
|
||||||
|
renderWith bg $ do
|
||||||
|
setSourceRGB 0 0 0
|
||||||
|
paint
|
||||||
|
_ -> do
|
||||||
rootSurface <- liftIO $ Util.createXlibSurface disp pixmap visual (fromIntegral rootWidth) (fromIntegral rootHeight)
|
rootSurface <- liftIO $ Util.createXlibSurface disp pixmap visual (fromIntegral rootWidth) (fromIntegral rootHeight)
|
||||||
|
|
||||||
renderWith bg $ withPatternForSurface rootSurface $ \pattern -> do
|
renderWith bg $ withPatternForSurface rootSurface $ \pattern -> do
|
||||||
|
|
Reference in a new issue