From a1d755a5f833c47d9c6fde4da1ec7e9e8631f1ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?William=20Sj=C3=B6blom?= Date: Wed, 19 Jan 2022 11:22:07 +0100 Subject: [PATCH] Always log screen layout if validation fails Unconditionally log the erroneous screen layout if it fails to validate to simplify debugging. --- vncviewer/DesktopWindow.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 12904188..9b086f4f 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -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); -- 2.39.5