Add client method to send SetDesktopSize.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3711 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/CMsgWriterV3.cxx b/common/rfb/CMsgWriterV3.cxx
index a980795..0a44fc6 100644
--- a/common/rfb/CMsgWriterV3.cxx
+++ b/common/rfb/CMsgWriterV3.cxx
@@ -47,3 +47,31 @@
{
os->flush();
}
+
+void CMsgWriterV3::writeSetDesktopSize(int width, int height,
+ const ScreenSet& layout)
+{
+ if (!cp->supportsSetDesktopSize)
+ throw Exception("Server does not support SetDesktopSize");
+
+ startMsg(msgTypeSetDesktopSize);
+ os->pad(1);
+
+ os->writeU16(width);
+ os->writeU16(height);
+
+ os->writeU8(layout.num_screens());
+ os->pad(1);
+
+ ScreenSet::const_iterator iter;
+ for (iter = layout.begin();iter != layout.end();++iter) {
+ os->writeU32(iter->id);
+ os->writeU16(iter->dimensions.tl.x);
+ os->writeU16(iter->dimensions.tl.y);
+ os->writeU16(iter->dimensions.width());
+ os->writeU16(iter->dimensions.height());
+ os->writeU32(iter->flags);
+ }
+
+ endMsg();
+}