mike-jumper commented on code in PR #547: URL: https://github.com/apache/guacamole-server/pull/547#discussion_r1747473202
########## src/protocols/vnc/display.c: ########## @@ -51,6 +51,18 @@ void guac_vnc_update(rfbClient* client, int x, int y, int w, int h) { guac_client* gc = rfbClientGetClientData(client, GUAC_VNC_CLIENT_KEY); guac_vnc_client* vnc_client = (guac_vnc_client*) gc->data; + /* Resize the surface if VNC screen size has changed */ + int old_height = vnc_client->display->default_surface->height; + int old_width = vnc_client->display->default_surface->width; + int new_height = rfbClientSwap16IfLE(client->screen.height); + int new_width = rfbClientSwap16IfLE(client->screen.width); + if ( + new_height > 0 && new_width > 0 + && (new_height != old_height || new_width != old_width) + ) + guac_common_surface_resize(vnc_client->display->default_surface, + new_width, new_height); Review Comment: Since the condition in this `if` block is lengthy, I think we should include braces around the body for readability. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org