aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2019-12-09 15:24:15 +0100
committerPierre Ossman <ossman@cendio.se>2019-12-09 15:24:15 +0100
commit86f4f47365f61ccf6104973317af227d6166d7a0 (patch)
tree991a74feaf3cc3a856ee77ff8667fd418715099c /common
parent38fe6d08e12457250f60e7b8b7c70c1d67f7c088 (diff)
downloadtigervnc-86f4f47365f61ccf6104973317af227d6166d7a0.tar.gz
tigervnc-86f4f47365f61ccf6104973317af227d6166d7a0.zip
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.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/EncodeManager.cxx4
1 files changed, 3 insertions, 1 deletions
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);
}