aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CConnection.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-06-20 15:47:49 +0200
committerPierre Ossman <ossman@cendio.se>2018-11-01 16:11:42 +0100
commit6ea58ba97b93331ef3dc8fc6daf973612561773a (patch)
treef4c203274e1a5ee8de7053431dbe0f6a8e9bee2c /common/rfb/CConnection.cxx
parentdc738ac7545585b12e904f8ebc90327acbc51ddf (diff)
downloadtigervnc-6ea58ba97b93331ef3dc8fc6daf973612561773a.tar.gz
tigervnc-6ea58ba97b93331ef3dc8fc6daf973612561773a.zip
Merge client resize capabilities
No need to have one setting for each extension. All the client code needs to indicate is if it supports resize. The common code can then map this to relevant extensions.
Diffstat (limited to 'common/rfb/CConnection.cxx')
-rw-r--r--common/rfb/CConnection.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index e61c2e72..98ef5862 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -73,6 +73,11 @@ void CConnection::setFramebuffer(ModifiablePixelBuffer* fb)
{
decoder.flush();
+ if (fb) {
+ assert(fb->width() == server.width());
+ assert(fb->height() == server.height());
+ }
+
if ((framebuffer != NULL) && (fb != NULL)) {
Rect rect;
@@ -334,6 +339,11 @@ void CConnection::setDesktopSize(int w, int h)
writer()->writeEnableContinuousUpdates(true, 0, 0,
server.width(),
server.height());
+
+ resizeFramebuffer();
+ assert(framebuffer != NULL);
+ assert(framebuffer->width() == server.width());
+ assert(framebuffer->height() == server.height());
}
void CConnection::setExtendedDesktopSize(unsigned reason,
@@ -349,6 +359,11 @@ void CConnection::setExtendedDesktopSize(unsigned reason,
writer()->writeEnableContinuousUpdates(true, 0, 0,
server.width(),
server.height());
+
+ resizeFramebuffer();
+ assert(framebuffer != NULL);
+ assert(framebuffer->width() == server.width());
+ assert(framebuffer->height() == server.height());
}
void CConnection::endOfContinuousUpdates()
@@ -452,6 +467,11 @@ void CConnection::initDone()
{
}
+void CConnection::resizeFramebuffer()
+{
+ assert(false);
+}
+
void CConnection::refreshFramebuffer()
{
forceNonincremental = true;
@@ -575,10 +595,10 @@ void CConnection::updateEncodings()
encodings.push_back(pseudoEncodingCursor);
encodings.push_back(pseudoEncodingXCursor);
}
- if (server.supportsDesktopResize)
+ if (server.supportsDesktopResize) {
encodings.push_back(pseudoEncodingDesktopSize);
- if (server.supportsExtendedDesktopSize)
encodings.push_back(pseudoEncodingExtendedDesktopSize);
+ }
if (server.supportsLEDState)
encodings.push_back(pseudoEncodingLEDState);