From fa6cda7b1d486019d51a06acfbb836d1d6256c77 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 3 Nov 2011 12:50:52 +0000 Subject: [PATCH] We informed the RFB layer of RENDER operations before they were actually carried out. Under some circumstances, this could result in an update going out with the old framebuffer contents. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4753 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/vncHooks.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/unix/xserver/hw/vnc/vncHooks.cc b/unix/xserver/hw/vnc/vncHooks.cc index 6d903a46..611ebcf5 100644 --- a/unix/xserver/hw/vnc/vncHooks.cc +++ b/unix/xserver/hw/vnc/vncHooks.cc @@ -556,6 +556,8 @@ void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen); PictureScreenPtr ps = GetPictureScreen(pScreen); + RegionHelper changed(pScreen); + if (pDst->pDrawable->type == DRAWABLE_WINDOW && ((WindowPtr) pDst->pDrawable)->viewable) { BoxRec box; @@ -567,20 +569,25 @@ void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, height); rect2 = rect1.intersect(vncHooksScreen->desktop->getRect()); - if (!rect2.is_empty()) { - box.x1 = rect2.tl.x; - box.y1 = rect2.tl.y; - box.x2 = rect2.br.x; - box.y2 = rect2.br.y; - RegionHelper changed(pScreen, &box, 0); - vncHooksScreen->desktop->add_changed(changed.reg); - } + + box.x1 = rect2.tl.x; + box.y1 = rect2.tl.y; + box.x2 = rect2.br.x; + box.y2 = rect2.br.y; + + changed.init(&box, 0); + } else { + changed.init(NullBox, 0); } + ps->Composite = vncHooksScreen->Composite; (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); ps->Composite = vncHooksComposite; + + if (REGION_NOTEMPTY(pScreen, changed.reg)) + vncHooksScreen->desktop->add_changed(changed.reg); } #endif /* RENDER */ -- 2.39.5