GUACAMOLE-1196: Correct VNC resize to conform to the RFB standard. #566
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request brings the VNC resize support in Guacamole in line with the RFB standard:
ExtendedDesktopSize
rectangle message from the server before trying to send its size to the server. Unless and until this has been received, noSetDesktopSize
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 theclient->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.guac_vnc_client
data structure to track this. If there's a better way to do this, do not hesitate to suggest it.configure.ac
checks and resulting definitions so that both therfbSetDesktopSizeMsg
andclient->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 theSetDesktopSize
message, anyway. Unfortunately, ignoring that breaks connections for the VNC servers that truly do not supportscreen
andSetDesktopSize
, 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.