Move copy rect handling to EncodeManager
No need to spread things out. Keep all of the handling in a single
place to make things clearer.
diff --git a/common/rfb/EncodeManager.cxx b/common/rfb/EncodeManager.cxx
index 7589cb6..9288668 100644
--- a/common/rfb/EncodeManager.cxx
+++ b/common/rfb/EncodeManager.cxx
@@ -325,6 +325,9 @@
changed = changed_;
+ if (!conn->client.useCopyRect)
+ changed.assign_union(copied);
+
/*
* We need to render the cursor seperately as it has its own
* magical pixel buffer, so split it out from the changed region.
@@ -344,7 +347,8 @@
conn->writer()->writeFramebufferUpdateStart(nRects);
- writeCopyRects(copied, copyDelta);
+ if (conn->client.useCopyRect)
+ writeCopyRects(copied, copyDelta);
/*
* We start by searching for solid rects, which are then removed