encodingChange(false), sameMachine(false), fullScreen(::fullScreen),
ctrlDown(false), altDown(false),
menuKeysym(0), menu(dpy, this), options(dpy, this), about(dpy), info(dpy),
- reverseConnection(reverse)
+ reverseConnection(reverse), firstUpdate(true)
{
CharArray menuKeyStr(menuKey.getData());
menuKeysym = XStringToKeysym(menuKeyStr.buf);
const rfb::ScreenSet& layout) {
CConnection::setExtendedDesktopSize(reason, result, w, h, layout);
- if ((reason == reasonClient) && (result != resultSuccess))
+ if ((reason == reasonClient) && (result != resultSuccess)) {
+ vlog.error("SetDesktopSize failed: %d", result);
return;
+ }
resizeFramebuffer();
}
debugRects.clear();
}
desktop->framebufferUpdateEnd();
+
+ if (firstUpdate) {
+ int width, height;
+
+ if (cp.supportsSetDesktopSize &&
+ sscanf(desktopSize.getValueStr(), "%dx%d", &width, &height) == 2) {
+ ScreenSet layout;
+
+ layout = cp.screenLayout;
+
+ if (layout.num_screens() == 0)
+ layout.add_screen(rfb::Screen());
+ else if (layout.num_screens() != 1) {
+ ScreenSet::iterator iter;
+
+ while (true) {
+ iter = layout.begin();
+ ++iter;
+
+ if (iter == layout.end())
+ break;
+
+ layout.remove_screen(iter->id);
+ }
+ }
+
+ layout.begin()->dimensions.tl.x = 0;
+ layout.begin()->dimensions.tl.y = 0;
+ layout.begin()->dimensions.br.x = width;
+ layout.begin()->dimensions.br.y = height;
+
+ writer()->writeSetDesktopSize(width, height, layout);
+ }
+
+ firstUpdate = false;
+ }
+
if (autoSelect)
autoSelectFormatAndEncoding();
requestNewUpdate();
"server as well as the clipboard selection",
true);
+StringParameter desktopSize("DesktopSize",
+ "Reconfigure desktop size on the server on "
+ "connect (if possible)", "");
+
BoolParameter listenMode("listen", "Listen for connections from VNC servers",
false);
StringParameter geometry("geometry", "X geometry specification", "");