From 86f4f47365f61ccf6104973317af227d6166d7a0 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 9 Dec 2019 15:24:15 +0100 Subject: [PATCH] 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. --- common/rfb/EncodeManager.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.39.5