]> source.dussan.org Git - tigervnc.git/commitdiff
We informed the RFB layer of RENDER operations before they were actually
authorPierre Ossman <ossman@cendio.se>
Thu, 3 Nov 2011 12:50:52 +0000 (12:50 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 3 Nov 2011 12:50:52 +0000 (12:50 +0000)
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

index 6d903a46e6266d49d4e12134333ac5d2f2d8084e..611ebcf5e8eabe7e2acd94dc2de835955defd833 100644 (file)
@@ -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 */