summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2009-03-21 21:16:14 +0000
committerPierre Ossman <ossman@cendio.se>2009-03-21 21:16:14 +0000
commit34bb06193e20940e269bff1740939d6ed286856c (patch)
tree4b3b0fe14c2fa79cef459dcb1ad5626ec9d7189f /common
parentd85ea3e1992b4415eab63c343a892b0f7dd50db4 (diff)
downloadtigervnc-34bb06193e20940e269bff1740939d6ed286856c.tar.gz
tigervnc-34bb06193e20940e269bff1740939d6ed286856c.zip
Properly parse the SetDesktopSize message.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3708 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r--common/rfb/SMsgHandler.cxx6
-rw-r--r--common/rfb/SMsgHandler.h5
-rw-r--r--common/rfb/SMsgReaderV3.cxx18
-rw-r--r--common/rfb/VNCSConnectionST.cxx3
-rw-r--r--common/rfb/VNCSConnectionST.h3
5 files changed, 28 insertions, 7 deletions
diff --git a/common/rfb/SMsgHandler.cxx b/common/rfb/SMsgHandler.cxx
index 0c74f0f5..8124c50d 100644
--- a/common/rfb/SMsgHandler.cxx
+++ b/common/rfb/SMsgHandler.cxx
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2009 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +18,7 @@
*/
#include <rfb/Exception.h>
#include <rfb/SMsgHandler.h>
+#include <rfb/ScreenSet.h>
using namespace rfb;
@@ -47,9 +49,11 @@ void SMsgHandler::supportsLocalCursor()
{
}
-void SMsgHandler::setDesktopSize(int fb_width, int fb_height)
+void SMsgHandler::setDesktopSize(int fb_width, int fb_height,
+ const ScreenSet& layout)
{
cp.width = fb_width;
cp.height = fb_height;
+ cp.screenLayout = layout;
}
diff --git a/common/rfb/SMsgHandler.h b/common/rfb/SMsgHandler.h
index 78cff2f7..f212edfd 100644
--- a/common/rfb/SMsgHandler.h
+++ b/common/rfb/SMsgHandler.h
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2009 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +27,7 @@
#include <rfb/PixelFormat.h>
#include <rfb/ConnParams.h>
#include <rfb/InputHandler.h>
+#include <rfb/ScreenSet.h>
namespace rdr { class InStream; }
@@ -46,7 +48,8 @@ namespace rfb {
virtual void setPixelFormat(const PixelFormat& pf);
virtual void setEncodings(int nEncodings, rdr::U32* encodings);
virtual void framebufferUpdateRequest(const Rect& r, bool incremental) = 0;
- virtual void setDesktopSize(int fb_width, int fb_height) = 0;
+ virtual void setDesktopSize(int fb_width, int fb_height,
+ const ScreenSet& layout) = 0;
// InputHandler interface
// The InputHandler methods will be called for the corresponding messages.
diff --git a/common/rfb/SMsgReaderV3.cxx b/common/rfb/SMsgReaderV3.cxx
index 1408fe66..168e6aab 100644
--- a/common/rfb/SMsgReaderV3.cxx
+++ b/common/rfb/SMsgReaderV3.cxx
@@ -24,6 +24,7 @@
#include <rdr/InStream.h>
#include <rfb/SMsgReaderV3.h>
#include <rfb/SMsgHandler.h>
+#include <rfb/ScreenSet.h>
using namespace rfb;
@@ -64,6 +65,9 @@ void SMsgReaderV3::readSetDesktopSize()
{
int width, height;
int screens, i;
+ rdr::U32 id, flags;
+ int sx, sy, sw, sh;
+ ScreenSet layout;
is->skip(1);
@@ -73,9 +77,17 @@ void SMsgReaderV3::readSetDesktopSize()
screens = is->readU8();
is->skip(1);
- // XXX: We don't support this command properly yet
- is->skip(screens * 16);
+ for (i = 0;i < screens;i++) {
+ id = is->readU32();
+ sx = is->readU16();
+ sy = is->readU16();
+ sw = is->readU16();
+ sh = is->readU16();
+ flags = is->readU32();
- handler->setDesktopSize(width, height);
+ layout.add_screen(Screen(id, sx, sy, sw, sh, flags));
+ }
+
+ handler->setDesktopSize(width, height, layout);
}
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index 10050e38..29c62746 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -509,7 +509,8 @@ void VNCSConnectionST::framebufferUpdateRequest(const Rect& r,bool incremental)
}
}
-void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height)
+void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
+ const ScreenSet& layout)
{
vlog.info("Rejecting client request to change desktop size");
writer()->writeExtendedDesktopSize(resultProhibited);
diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h
index d5c7a36b..c1750b92 100644
--- a/common/rfb/VNCSConnectionST.h
+++ b/common/rfb/VNCSConnectionST.h
@@ -125,7 +125,8 @@ namespace rfb {
virtual void keyEvent(rdr::U32 key, bool down);
virtual void clientCutText(const char* str, int len);
virtual void framebufferUpdateRequest(const Rect& r, bool incremental);
- virtual void setDesktopSize(int fb_width, int fb_height);
+ virtual void setDesktopSize(int fb_width, int fb_height,
+ const ScreenSet& layout);
virtual void setInitialColourMap();
virtual void supportsLocalCursor();