Skip to content

Conversation

@rene-oromtz
Copy link
Contributor

@rene-oromtz rene-oromtz commented Nov 19, 2025

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.Screen which is now deprecated but is proven to be more reliable in older environments.

With Gdk4, the gdk.Display and gdk.Monitor is 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

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 87.80488% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.63%. Comparing base (47817ad) to head (5850f01).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/resolution_test.py 87.80% 4 Missing and 1 partial ⚠️

❌ 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     
Flag Coverage Δ
provider-base 30.90% <87.80%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pieqq pieqq requested a review from Copilot November 19, 2025 15:47
@pieqq pieqq self-assigned this Nov 19, 2025
Copy link

Copilot AI left a 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.

Copy link
Collaborator

@pieqq pieqq left a 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!

@pieqq pieqq merged commit a65231d into main Nov 20, 2025
31 of 32 checks passed
@pieqq pieqq deleted the fix_minimum_resolution branch November 20, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minimum_resolution tests failure due to script not considering scaling

3 participants