summaryrefslogtreecommitdiff
path: root/composite/compalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'composite/compalloc.c')
-rw-r--r--composite/compalloc.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 433dc820a..3e2f14fb0 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -47,24 +47,18 @@
#include "compint.h"
-static void
-compScreenUpdate(ScreenPtr pScreen)
-{
- compCheckTree(pScreen);
- compPaintChildrenToWindow(pScreen->root);
-}
-
-static void
-compBlockHandler(ScreenPtr pScreen, void *pTimeout)
+static Bool
+compScreenUpdate(ClientPtr pClient, void *closure)
{
+ ScreenPtr pScreen = closure;
CompScreenPtr cs = GetCompScreen(pScreen);
- pScreen->BlockHandler = cs->BlockHandler;
- compScreenUpdate(pScreen);
- (*pScreen->BlockHandler) (pScreen, pTimeout);
+ compCheckTree(pScreen);
+ compPaintChildrenToWindow(pScreen->root);
- /* Next damage will restore the block handler */
- cs->BlockHandler = NULL;
+ /* Next damage will restore the worker */
+ cs->pendingScreenUpdate = FALSE;
+ return TRUE;
}
void
@@ -87,9 +81,9 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
CompScreenPtr cs = GetCompScreen(pScreen);
CompWindowPtr cw = GetCompWindow(pWin);
- if (!cs->BlockHandler) {
- cs->BlockHandler = pScreen->BlockHandler;
- pScreen->BlockHandler = compBlockHandler;
+ if (!cs->pendingScreenUpdate) {
+ QueueWorkProc(compScreenUpdate, serverClient, pScreen);
+ cs->pendingScreenUpdate = TRUE;
}
cw->damaged = TRUE;