-
Notifications
You must be signed in to change notification settings - Fork 654
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
add 1024x576 as an intermediate GUI resolution for smaller screens #3811
Conversation
: (screenSize.width >= 1280 && screenSize.height >= 720) | ||
? const Size(1024, 576) // For screens 1280x720 or larger | ||
: const Size(750, 450) // Default window size | ||
: const Size(750, 450); // Default window size if screenSize is null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean if it is null? Should we fallback to the default or middle resolution in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If screenSize is null it means that the plugin cannot get the current screen resolution for some reason. Falling back to the minimum resolution is probably safest if this happens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why though? Isn't it safer to make a compromise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any situations where serving a larger resolution (when you don't know the size of the screen) is safer than serving the minimum resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safety is perhaps not the best concept here, but when "the plugin cannot get the current screen resolution for some reason", the most reasonable expectation is still that the user either doesn't have graphics at all, or they have 720p or higher (since most screens today have that). OTOH, the smallest size is our least preferred.
We can deal with this better later.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3811 +/- ##
=======================================
Coverage 88.94% 88.94%
=======================================
Files 256 256
Lines 14584 14584
=======================================
Hits 12972 12972
Misses 1612 1612 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I don't want to delay this any further, so approving.
For some reason GH is encountering some internal error (seen in other PRs too). The runs otherwise succeeded, so merging manually. https://github.com/canonical/multipass-private/actions/runs/12165023258 |
add 1024x576 as an intermediate GUI resolution for smaller screens
Some Macbooks and other small laptops have resolutions such as 1440x900 or 1366x768 that are below the threshold for the "large" GUI resolution of 1400x822's minimum screen size of 1600x900, but the default (minimum) of 750x450 is too small.
This PR updates the startup application window size logic in main.dart to add an intermediate 1024x576 resolution for smaller screens,
It now sets the window size to 1400x822 for screens 1600x900 or larger, 1024x576 for screens 1280x720 or larger, and defaults to 750x450 otherwise.