const ScreenSet& layout)
{
unsigned int result;
+ char buffer[2048];
- if (!accessCheck(AccessSetDesktopSize) || !rfb::Server::acceptSetDesktopSize)
+ vlog.debug("Got request for framebuffer resize to %dx%d",
+ fb_width, fb_height);
+ layout.print(buffer, sizeof(buffer));
+ vlog.debug("%s", buffer);
+
+ if (!accessCheck(AccessSetDesktopSize) ||
+ !rfb::Server::acceptSetDesktopSize) {
+ vlog.debug("Rejecting unauthorized framebuffer resize request");
result = resultProhibited;
- else
+ } else {
result = server->setDesktopSize(this, fb_width, fb_height, layout);
+ }
writer()->writeDesktopSize(reasonClient, result);
}
// We can't handle a framebuffer larger than this, so don't let a
// client set one (see PixelBuffer.cxx)
- if ((fb_width > 16384) || (fb_height > 16384))
+ if ((fb_width > 16384) || (fb_height > 16384)) {
+ slog.error("Rejecting too large framebuffer resize request");
return resultProhibited;
+ }
// Don't bother the desktop with an invalid configuration
- if (!layout.validate(fb_width, fb_height))
+ if (!layout.validate(fb_width, fb_height)) {
+ slog.error("Invalid screen layout requested by client");
return resultInvalid;
+ }
// FIXME: the desktop will call back to VNCServerST and an extra set
// of ExtendedDesktopSize messages will be sent. This is okay
i = getPreferredScreenOutput(outputIdMap, disabledOutputs);
/* Shouldn't happen */
- if (i == -1)
+ if (i == -1) {
+ if (logErrors)
+ vlog.error("Cannot find an available output for new screen layout");
return rfb::resultInvalid;
+ }
output = vncRandRGetOutputId(i);
/*
const rfb::ScreenSet& layout)
{
#ifdef HAVE_XRANDR
- char buffer[2048];
- vlog.debug("Got request for framebuffer resize to %dx%d",
- fb_width, fb_height);
- layout.print(buffer, sizeof(buffer));
- vlog.debug("%s", buffer);
-
XRRScreenResources *res = XRRGetScreenResources(dpy, DefaultRootWindow(dpy));
if (!res) {
vlog.error("XRRGetScreenResources failed");
{
unsigned int result;
- char buffer[2048];
- vlog.debug("Got request for framebuffer resize to %dx%d",
- fb_width, fb_height);
- layout.print(buffer, sizeof(buffer));
- vlog.debug("%s", buffer);
-
vncSetGlueContext(screenIndex);
result = ::setScreenLayout(fb_width, fb_height, layout, &outputIdMap);