Skip to content

Refactor: Move GTK-specific DPI logic to GtkDPIUtil #2280

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShahzaibIbrahim
Copy link
Contributor

This commit introduces a dedicated GtkDPIUtil class to isolate GTK-specific DPI logic, improving platform separation and maintainability.

Since the GTK scaling factor is always 1, the autoScaleUp and autoScaleDown methods effectively return the input unchanged. These methods and their usages have been removed from the GTK implementation to eliminate unnecessary code.

Also clarifies that autoScale no longer applies to the Win32 implementation and is being decoupled accordingly.

Copy link
Contributor

github-actions bot commented Jul 1, 2025

Test Results

   545 files  ±0     545 suites  ±0   32m 29s ⏱️ + 2m 29s
 4 405 tests ±0   4 387 ✅ ±0   18 💤 ±0  0 ❌ ±0 
16 741 runs  ±0  16 599 ✅ ±0  142 💤 ±0  0 ❌ ±0 

Results for commit daf36ff. ± Comparison against base commit 51fed8e.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would definitly split this one up into two PRs. One only containing the removal of probably unecessary DPIUtil-calls, and a second one with the rest

This commit introduces a dedicated `GtkDPIUtil` class to isolate
GTK-specific DPI logic, improving platform separation and
maintainability.

Since the GTK scaling factor is always 1, the `autoScaleUp` and
`autoScaleDown` methods effectively return the input unchanged. These
methods and their usages have been removed from the GTK implementation
to eliminate unnecessary code.

Also clarifies that `autoScale` no longer applies to the Win32
implementation and is being decoupled accordingly.
Copy link
Contributor

@fedejeanne fedejeanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but since this is GTK, I would like the opinion of @iloveeclipse and/or @akurtakov before merging it.

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.

[Refactor DPIUtil] Clean up no-op calls in gtk
3 participants