Properly parse the SetDesktopSize message.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3708 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/SMsgReaderV3.cxx b/common/rfb/SMsgReaderV3.cxx
index 1408fe6..168e6aa 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 @@
{
int width, height;
int screens, i;
+ rdr::U32 id, flags;
+ int sx, sy, sw, sh;
+ ScreenSet layout;
is->skip(1);
@@ -73,9 +77,17 @@
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);
}