diff options
-rw-r--r-- | common/rfb/CConnection.cxx | 24 | ||||
-rw-r--r-- | common/rfb/CConnection.h | 5 | ||||
-rw-r--r-- | common/rfb/ServerParams.cxx | 2 | ||||
-rw-r--r-- | common/rfb/ServerParams.h | 1 | ||||
-rw-r--r-- | vncviewer/CConn.cxx | 1 |
5 files changed, 28 insertions, 5 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); diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h index 56e6d143..a0fa54aa 100644 --- a/common/rfb/CConnection.h +++ b/common/rfb/CConnection.h @@ -127,6 +127,11 @@ namespace rfb { // returning. virtual void initDone() = 0; + // resizeFramebuffer() is called whenever the framebuffer + // dimensions or the screen layout changes. A subclass must make + // sure the pixel buffer has been updated once this call returns. + virtual void resizeFramebuffer(); + // Other methods diff --git a/common/rfb/ServerParams.cxx b/common/rfb/ServerParams.cxx index 9ae8a60a..289c8647 100644 --- a/common/rfb/ServerParams.cxx +++ b/common/rfb/ServerParams.cxx @@ -26,7 +26,7 @@ using namespace rfb; ServerParams::ServerParams() : majorVersion(0), minorVersion(0), supportsLocalCursor(false), - supportsDesktopResize(false), supportsExtendedDesktopSize(false), + supportsDesktopResize(false), supportsLEDState(false), supportsQEMUKeyEvent(false), supportsSetDesktopSize(false), supportsFence(false), supportsContinuousUpdates(false), diff --git a/common/rfb/ServerParams.h b/common/rfb/ServerParams.h index cae38cb5..09ebddc0 100644 --- a/common/rfb/ServerParams.h +++ b/common/rfb/ServerParams.h @@ -71,7 +71,6 @@ namespace rfb { bool supportsLocalCursor; bool supportsDesktopResize; - bool supportsExtendedDesktopSize; bool supportsLEDState; bool supportsQEMUKeyEvent; diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index 701e3f07..5c40a707 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -83,7 +83,6 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) server.supportsLocalCursor = true; server.supportsDesktopResize = true; - server.supportsExtendedDesktopSize = true; server.supportsLEDState = true; |