From: Pierre Ossman Date: Mon, 9 Dec 2019 14:24:15 +0000 (+0100) Subject: Correctly calculate rects with no CopyRect support X-Git-Tag: v1.10.90~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86f4f47365f61ccf6104973317af227d6166d7a0;p=tigervnc.git Correctly calculate rects with no CopyRect support The copied rects have already been merged in to the changed rects at this point if the client doesn't support the CopyRect encoding. --- diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx index 735be072..57020fee 100644 --- a/common/rfb/EncodeManager.cxx +++ b/common/rfb/EncodeManager.cxx @@ -340,7 +340,9 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_, if (conn->client.supportsEncoding(pseudoEncodingLastRect)) nRects = 0xFFFF; else { - nRects = copied.numRects(); + nRects = 0; + if (conn->client.supportsEncoding(encodingCopyRect)) + nRects += copied.numRects(); nRects += computeNumRects(changed); nRects += computeNumRects(cursorRegion); }