Avoid truncated window size after going from fullscreen to a window of the same size #214
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.
As discussed at https://bitbucket.org/OpenUru_org/cwe-ou/pull-request/18/fix-improperly-calculated-window-size-in#comment-8535 :
When going from fullscreen to windowed without changing the resolution, the window would end up smaller than intended, because the display resolution was still small (not reset to the full desktop resolution yet) at the time the window size was set, and Windows would clamp the total window size to slightly larger than the display resolution.
The display resolution must be reset before setting the window size (as the old Cyan code did).
I also found that on Windows XP, for whatever reason, setting window style WS_VISIBLE appears necessary to prevent the contents of the previous window from staying behind when going from windowed to a smaller window.
Tested on Windows XP (in CWE-ou only) and Windows 7 (CWE-ou and H-uru/Plasma).