Switch automatic composite update to WorkQueue
It is currently (ab)using the screen BlockHandler callback to do
this. But this can cause problems with other extension as their
block handlers might have executed before Composite's. And the
operations Composite does might result in them wanting to change
timeouts.
Practically this caused problems for TigerVNC's VNC extension which
failed to send out updates for Composite's screen updates.
(cherry picked from commit 1bd5d0a53c
)
This commit is contained in:
parent
a41b6ef224
commit
b1215fb075
|
@ -47,24 +47,18 @@
|
||||||
|
|
||||||
#include "compint.h"
|
#include "compint.h"
|
||||||
|
|
||||||
static void
|
static Bool
|
||||||
compScreenUpdate(ScreenPtr pScreen)
|
compScreenUpdate(ClientPtr pClient, void *closure)
|
||||||
{
|
|
||||||
compCheckTree(pScreen);
|
|
||||||
compPaintChildrenToWindow(pScreen->root);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
compBlockHandler(ScreenPtr pScreen, void *pTimeout)
|
|
||||||
{
|
{
|
||||||
|
ScreenPtr pScreen = closure;
|
||||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||||
|
|
||||||
pScreen->BlockHandler = cs->BlockHandler;
|
compCheckTree(pScreen);
|
||||||
compScreenUpdate(pScreen);
|
compPaintChildrenToWindow(pScreen->root);
|
||||||
(*pScreen->BlockHandler) (pScreen, pTimeout);
|
|
||||||
|
|
||||||
/* Next damage will restore the block handler */
|
/* Next damage will restore the worker */
|
||||||
cs->BlockHandler = NULL;
|
cs->pendingScreenUpdate = FALSE;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -87,9 +81,9 @@ compReportDamage(DamagePtr pDamage, RegionPtr pRegion, void *closure)
|
||||||
CompScreenPtr cs = GetCompScreen(pScreen);
|
CompScreenPtr cs = GetCompScreen(pScreen);
|
||||||
CompWindowPtr cw = GetCompWindow(pWin);
|
CompWindowPtr cw = GetCompWindow(pWin);
|
||||||
|
|
||||||
if (!cs->BlockHandler) {
|
if (!cs->pendingScreenUpdate) {
|
||||||
cs->BlockHandler = pScreen->BlockHandler;
|
QueueWorkProc(compScreenUpdate, serverClient, pScreen);
|
||||||
pScreen->BlockHandler = compBlockHandler;
|
cs->pendingScreenUpdate = TRUE;
|
||||||
}
|
}
|
||||||
cw->damaged = TRUE;
|
cw->damaged = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -387,6 +387,8 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
cs->pOverlayWin = NULL;
|
cs->pOverlayWin = NULL;
|
||||||
cs->pOverlayClients = NULL;
|
cs->pOverlayClients = NULL;
|
||||||
|
|
||||||
|
cs->pendingScreenUpdate = FALSE;
|
||||||
|
|
||||||
cs->numAlternateVisuals = 0;
|
cs->numAlternateVisuals = 0;
|
||||||
cs->alternateVisuals = NULL;
|
cs->alternateVisuals = NULL;
|
||||||
cs->numImplicitRedirectExceptions = 0;
|
cs->numImplicitRedirectExceptions = 0;
|
||||||
|
@ -442,8 +444,6 @@ compScreenInit(ScreenPtr pScreen)
|
||||||
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
|
cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes;
|
||||||
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
|
pScreen->ChangeWindowAttributes = compChangeWindowAttributes;
|
||||||
|
|
||||||
cs->BlockHandler = NULL;
|
|
||||||
|
|
||||||
cs->CloseScreen = pScreen->CloseScreen;
|
cs->CloseScreen = pScreen->CloseScreen;
|
||||||
pScreen->CloseScreen = compCloseScreen;
|
pScreen->CloseScreen = compCloseScreen;
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,8 @@ typedef struct _CompScreen {
|
||||||
*/
|
*/
|
||||||
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
|
||||||
|
|
||||||
ScreenBlockHandlerProcPtr BlockHandler;
|
Bool pendingScreenUpdate;
|
||||||
|
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
int numAlternateVisuals;
|
int numAlternateVisuals;
|
||||||
VisualID *alternateVisuals;
|
VisualID *alternateVisuals;
|
||||||
|
|
Loading…
Reference in New Issue