Fix remember size and position regression in which vertical size could grow when reopening the VM #6239
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.


Summary
Fixes the regression introduced in #6233 in which the vertical size could keep growing on VM reopen when remembering size and pos, due to not removing from the height the showed or hidden non-content elements (toolbar and status bar).
This fix ensures they are taken into account for the vertical size.
Tested with multiple combinations of parameters while reopening the machine, this time taking into account only the size of the content area. Of course including Hide Toolbar, Hide Status Bar and combinations of those while reopening the VM and ensuring the size remains.
Unfortunately it is extremely hard to ensure that this functionality works correctly in all cases as there are too many parameters that interact with each other sometimes even in contradicting ways. That said, I can just offer to jump in whenever anything is found related to any of my changes to fix it to the best of my ability.
Checklist
References
(#6233)
https://discord.com/channels/262614059009048590/1421479562029830154