Skip to content

Commit

Permalink
Always log screen layout if validation fails
Browse files Browse the repository at this point in the history
Unconditionally log the erroneous screen layout if it fails to
validate to simplify debugging.
  • Loading branch information
williamsjoblom committed Jan 19, 2022
1 parent 88e96d6 commit a1d755a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vncviewer/DesktopWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1392,15 +1392,17 @@ void DesktopWindow::remoteResize(int width, int height)
(layout == cc->server.screenLayout()))
return;

char buffer[2048];
vlog.debug("Requesting framebuffer resize from %dx%d to %dx%d",
cc->server.width(), cc->server.height(), width, height);
layout.print(buffer, sizeof(buffer));
vlog.debug("%s", buffer);

char buffer[2048];
layout.print(buffer, sizeof(buffer));
if (!layout.validate(width, height)) {
vlog.error(_("Invalid screen layout computed for resize request!"));
vlog.error("%s", buffer);
return;
} else {
vlog.debug("%s", buffer);
}

cc->writer()->writeSetDesktopSize(width, height, layout);
Expand Down

0 comments on commit a1d755a

Please sign in to comment.