]> source.dussan.org Git - tigervnc.git/commitdiff
Always log screen layout if validation fails 1411/head
authorWilliam Sjöblom <wilsj@cendio.com>
Wed, 19 Jan 2022 10:22:07 +0000 (11:22 +0100)
committerWilliam Sjöblom <wilsj@cendio.com>
Wed, 19 Jan 2022 12:02:26 +0000 (13:02 +0100)
Unconditionally log the erroneous screen layout if it fails to
validate to simplify debugging.

vncviewer/DesktopWindow.cxx

index 129041882f4a93e6306f05e59d4d60d465c8c7f7..9b086f4f530245ae8ae7112ec4d1e4af24e01b70 100644 (file)
@@ -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);