Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUACAMOLE-1196: Correct VNC resize to conform to the RFB standard. #566

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

necouchman
Copy link
Contributor

This pull request brings the VNC resize support in Guacamole in line with the RFB standard:

  • The client must receive an ExtendedDesktopSize rectangle message from the server before trying to send its size to the server. Unless and until this has been received, no SetDesktopSize message can be sent, and sending it will either be ignored by the server or cause the server to drop the connection. In libvncclient, the receipt of this message initializes the client->screen data structure, so we test for that in order to find out if the message has been sent and we are allowed to send the client size to the server.
  • This makes the initial sizing of the remote desktop to the client size a bit challenging, since we cannot send that initial message until we've received and processed at least one message from the server. So, I had to shift around the stuff in main client thread a bit, add a couple of flag members to the guac_vnc_client data structure to track this. If there's a better way to do this, do not hesitate to suggest it.
  • I also simplified the configure.ac checks and resulting definitions so that both the rfbSetDesktopSizeMsg and client->screen items need to be present for it to be enabled.

If I recall correctly during testing, there were some VNC servers that supported resizing even though they did not initialize or support the screen members, and so some of the changes we had made in trying to get this to work intentionally ignored that and tried to send the SetDesktopSize message, anyway. Unfortunately, ignoring that breaks connections for the VNC servers that truly do not support screen and SetDesktopSize, so it seems like it is likely best to just follow the RFB standard and the way the libvncclient implements that standard and go this route.

Final note, it does look like the SendDesktopSize() function in libvncclient is still broken, at least, in the version being pulled in by the Alpine Linux distro for the Docker image, and I couldn't get that to work with a VNC server that I know supports resizing properly. So, I've fallen back to not using that built-in function, and, instead, implementing one that does more or less the same things, but 1) actually works, and 2) can log things in a way that the Guacamole admins can see.

@mike-jumper mike-jumper merged commit 54c68de into apache:staging/1.6.0 Dec 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants