]> source.dussan.org Git - tigervnc.git/commitdiff
Correctly calculate rects with no CopyRect support
authorPierre Ossman <ossman@cendio.se>
Mon, 9 Dec 2019 14:24:15 +0000 (15:24 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 9 Dec 2019 14:24:15 +0000 (15:24 +0100)
The copied rects have already been merged in to the changed rects
at this point if the client doesn't support the CopyRect encoding.

common/rfb/EncodeManager.cxx

index 735be072a8f70ddff83ec5601fdccc6f36a189b1..57020fee42ea15f8ded4acb21fee5d538633a24d 100644 (file)
@@ -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);
     }