/* 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
*/
#include <rfb/Exception.h>
#include <rfb/SMsgHandler.h>
+#include <rfb/ScreenSet.h>
using namespace rfb;
{
}
-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;
}
/* 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
#include <rfb/PixelFormat.h>
#include <rfb/ConnParams.h>
#include <rfb/InputHandler.h>
+#include <rfb/ScreenSet.h>
namespace rdr { class InStream; }
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.
#include <rdr/InStream.h>
#include <rfb/SMsgReaderV3.h>
#include <rfb/SMsgHandler.h>
+#include <rfb/ScreenSet.h>
using namespace rfb;
{
int width, height;
int screens, i;
+ rdr::U32 id, flags;
+ int sx, sy, sw, sh;
+ ScreenSet layout;
is->skip(1);
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);
}
}
}
-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);
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();