diff options
author | Peter Åstrand <astrand@cendio.se> | 2005-08-17 08:33:29 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2005-08-17 08:33:29 +0000 |
commit | d77d6aaac9a5c72c1de37b44f78b77b251aa8c4a (patch) | |
tree | 497b8858542a656cb04f36571706240bfdbdd122 /xc | |
parent | 5a2c81e26059414693ce1c9b66745920a3d4cb6c (diff) | |
download | tigervnc-d77d6aaac9a5c72c1de37b44f78b77b251aa8c4a.tar.gz tigervnc-d77d6aaac9a5c72c1de37b44f78b77b251aa8c4a.zip |
Updated vncHooksComposite, to fix additional RENDER problems. It's not
enough to check that xDst/yDst is greater than zero: we must take
greater care not to add change regions that are fully or partially
outside the framebuffer.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@305 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'xc')
-rw-r--r-- | xc/programs/Xserver/vnc/vncHooks.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/xc/programs/Xserver/vnc/vncHooks.cc b/xc/programs/Xserver/vnc/vncHooks.cc index d040e4f5..34c7aca3 100644 --- a/xc/programs/Xserver/vnc/vncHooks.cc +++ b/xc/programs/Xserver/vnc/vncHooks.cc @@ -504,21 +504,22 @@ void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, vncHooksScreenPtr vncHooksScreen = ((vncHooksScreenPtr)pScreen->devPrivates[vncHooksScreenIndex].ptr); BoxRec box; PictureScreenPtr ps = GetPictureScreen(pScreen); - - // For some reason, this hook is sometimes called with a negative - // xDst. This causes graphics errors, as well as error messages of - // the type: - // ComparingUpdateTracker: rect outside fb (-47,76-171,89) - // I've never observed a negative yDst, but let's check it anyway. - if ((xDst >= 0) && (yDst >= 0)) { - box.x1 = pDst->pDrawable->x + xDst; - box.y1 = pDst->pDrawable->y + yDst; - box.x2 = box.x1 + width; - box.y2 = box.y1 + height; - - RegionHelper changed(pScreen, &box, 0); - vncHooksScreen->desktop->add_changed(changed.reg); - } + rfb::Rect rect1, rect2; + + rect1.setXYWH(pDst->pDrawable->x + xDst, + pDst->pDrawable->y + yDst, + width, + 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); + } ps->Composite = vncHooksScreen->Composite; (*ps->Composite)(op, pSrc, pMask, pDst, xSrc, ySrc, |