Make the comparing update tracker a bit more flexible. It can now be in an
"auto" state where it will be enabled until we deem that the client is better
of without it (currently triggered by explicitly stating a low compression
level).
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4809 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index d0cdf86..466d6d5 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -326,6 +326,16 @@
return secsToMillis(timeLeft);
}
+
+bool VNCSConnectionST::getComparerState()
+{
+ // We interpret a low compression level as an indication that the client
+ // wants to prioritise CPU usage over bandwidth, and hence disable the
+ // comparing update tracker.
+ return (cp.compressLevel == -1) || (cp.compressLevel > 1);
+}
+
+
// renderedCursorChange() is called whenever the server-side rendered cursor
// changes shape or position. It ensures that the next update will clean up
// the old rendered cursor and if necessary draw the new rendered cursor.