diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-06-20 12:25:14 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-01 16:11:42 +0100 |
commit | 9312b0e3e16a0eee66945a1220d914067132de9a (patch) | |
tree | 78a8574b9d91bf6c1613d5a6f543e7454029638e /common/rfb/CMsgHandler.cxx | |
parent | 0fe375a209dd917de5cbabbfbe5915b9b58f8fa8 (diff) | |
download | tigervnc-9312b0e3e16a0eee66945a1220d914067132de9a.tar.gz tigervnc-9312b0e3e16a0eee66945a1220d914067132de9a.zip |
Encapsulate screen layout storage in ConnParams
Avoid direct access to the screen dimensions and layout so that we
can make sure it stays sane. This also makes sure the layout is
properly updated when we only get the screen dimensions from the
server.
Diffstat (limited to 'common/rfb/CMsgHandler.cxx')
-rw-r--r-- | common/rfb/CMsgHandler.cxx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/common/rfb/CMsgHandler.cxx b/common/rfb/CMsgHandler.cxx index b89bc184..03e66e83 100644 --- a/common/rfb/CMsgHandler.cxx +++ b/common/rfb/CMsgHandler.cxx @@ -34,8 +34,7 @@ CMsgHandler::~CMsgHandler() void CMsgHandler::setDesktopSize(int width, int height) { - cp.width = width; - cp.height = height; + cp.setDimensions(width, height); } void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result, @@ -47,12 +46,7 @@ void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result, if ((reason == reasonClient) && (result != resultSuccess)) return; - if (!layout.validate(width, height)) - fprintf(stderr, "Server sent us an invalid screen layout\n"); - - cp.width = width; - cp.height = height; - cp.screenLayout = layout; + cp.setDimensions(width, height, layout); } void CMsgHandler::setPixelFormat(const PixelFormat& pf) |