Apply display scale before sizing the startup window - #797
Open
csfreitas wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related issue: #728
What was going wrong?
Starting Julius with
--display-scale 1.5and a saved window size of 640x480 could still open a 640x480 window at 100% scale, instead of the expected 960x720 window at 150%.The window dimensions were calculated before the requested scale took effect. When recreating the window, the previous scale could also affect its new size.
What this changes
The requested scale is now applied before calculating the startup window size, using the selected display's available space.
Testing
Added a regression test using SDL's dummy video driver. It covers 50%, 100% and 150% scaling, repeated window creation, oversized saved windows, excessive scale, and invalid display selection.
Relation to #728
This fixes a reproducible startup scaling problem related to #728. I have not reproduced the original reporter's exact 4K setup, so I am not claiming that this resolves the entire issue.