aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-11-15 12:13:37 +0000
committerPierre Ossman <ossman@cendio.se>2011-11-15 12:13:37 +0000
commitaa73c89d77088b64225d73cf37597c68e201088e (patch)
tree07a1071d57640c1be21b867f945123e4e39cf0e1
parent36dadf85f410f1de283b1e363aa06d8a320834d8 (diff)
downloadtigervnc-aa73c89d77088b64225d73cf37597c68e201088e.tar.gz
tigervnc-aa73c89d77088b64225d73cf37597c68e201088e.zip
Client side support for continuous updates.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4805 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/CConn.cxx26
-rw-r--r--vncviewer/CConn.h1
2 files changed, 20 insertions, 7 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index 4cc09f22..fbd9a8ed 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -72,7 +72,7 @@ CConn::CConn(const char* vncServerName)
pendingPFChange(false),
currentEncoding(encodingTight), lastServerEncoding((unsigned int)-1),
formatChange(false), encodingChange(false),
- firstUpdate(true), pendingUpdate(false),
+ firstUpdate(true), pendingUpdate(false), continuousUpdates(false),
forceNonincremental(true), supportsSyncFence(false)
{
setShared(::shared);
@@ -306,8 +306,8 @@ void CConn::framebufferUpdateEnd()
if (firstUpdate) {
int width, height;
- // We need fences to make extra update requests "safe".
- // See fence() for the next step.
+ // We need fences to make extra update requests and continuous
+ // updates "safe". See fence() for the next step.
if (cp.supportsFence)
writer()->writeFence(fenceFlagRequest | fenceFlagSyncNext, 0, NULL);
@@ -448,8 +448,15 @@ void CConn::fence(rdr::U32 flags, unsigned len, const char data[])
if (len == 0) {
// Initial probe
- if (flags & fenceFlagSyncNext)
+ if (flags & fenceFlagSyncNext) {
supportsSyncFence = true;
+
+ if (cp.supportsContinuousUpdates) {
+ vlog.info(_("Enabling continuous updates"));
+ continuousUpdates = true;
+ writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, cp.height);
+ }
+ }
} else {
// Pixel format change
rdr::MemInStream memStream(data, len);
@@ -477,6 +484,9 @@ void CConn::resizeFramebuffer()
if (!desktop)
return;
+ if (continuousUpdates)
+ writer()->writeEnableContinuousUpdates(true, 0, 0, cp.width, cp.height);
+
desktop->resizeFramebuffer(cp.width, cp.height);
}
@@ -609,9 +619,11 @@ void CConn::requestNewUpdate()
checkEncodings();
- pendingUpdate = true;
- writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
- !forceNonincremental);
+ if (forceNonincremental || !continuousUpdates) {
+ pendingUpdate = true;
+ writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
+ !forceNonincremental);
+ }
forceNonincremental = false;
}
diff --git a/vncviewer/CConn.h b/vncviewer/CConn.h
index 25d10e78..ea4edb55 100644
--- a/vncviewer/CConn.h
+++ b/vncviewer/CConn.h
@@ -107,6 +107,7 @@ private:
bool firstUpdate;
bool pendingUpdate;
+ bool continuousUpdates;
bool forceNonincremental;