-
Notifications
You must be signed in to change notification settings - Fork 71
Fix minimium_resolution tests for Ubuntu 25+ (Bugfix) #2205
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
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (87.80%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2205 +/- ##
==========================================
+ Coverage 53.49% 53.63% +0.14%
==========================================
Files 401 401
Lines 43079 43116 +37
Branches 7983 7990 +7
==========================================
+ Hits 23045 23127 +82
+ Misses 19223 19177 -46
- Partials 811 812 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR fixes the minimum_resolution tests to properly handle display scaling on Ubuntu 25+ (Plucky Puffin). The issue occurred because high-density monitors with scaling factors would report resolutions below the 800x600 minimum when scaling wasn't accounted for.
Key Changes:
- Updates resolution detection to use GTK4/Gdk4 APIs for Ubuntu 25+ while maintaining GTK3/Gdk3 compatibility for older releases
- Applies scale factors to monitor geometry calculations to accurately determine effective resolution
- Adds comprehensive unit tests covering both GTK3 and GTK4 code paths with various scaling scenarios
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pieqq
left a comment
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.
Thank you for fixing this, and thank you for a very clear description, the unit tests and the runs on the different impacted environments!
Description
This PR fixes the problem where the scale factor was not being considered.
Starting Ubuntu Plucky Puffin (25+) Minimum_resolution tests was failing in those environments as on high density monitors, the detected resolution was below the minimum 800x600
The script now determine if it should use Gdk/Gtk4 (25+) or Gdk3. For keeping backwards compatibility, Gdk3 still uses the
gdk.Screenwhich is now deprecated but is proven to be more reliable in older environments.With Gdk4, the
gdk.Displayandgdk.Monitoris used instead taking into account the scale factor while calculating the display geometry.Resolved issues
Resolves #2178
Documentation
Tests
This PR was tested on Questing (25.10) with both integer and fractional scale factor:
Submissions:
Scale Factor of 2: https://certification.canonical.com/hardware/202102-28727/submission/459925/
Scale Factor of 1.5: https://certification.canonical.com/hardware/202102-28727/submission/459926/
In both scenarios, the resolution considers the scaling to report a resolution of 1920 x 1080
For testing backwards compatibility, also submitted a test run from Noble:
https://certification.canonical.com/hardware/202102-28727/submission/459927/
Additionally, unit tests were added to test this behavior