Skip to content

Refactor: Move Win32-specific DPI logic to Win32DPIUtils #2281

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

Merged
merged 2 commits into from
Jul 14, 2025

Conversation

ShahzaibIbrahim
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim commented Jul 2, 2025

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

This PR:

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft July 2, 2025 10:01
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Test Results

   546 files  + 1     546 suites  +1   29m 25s ⏱️ - 7m 29s
 4 407 tests + 1   4 390 ✅ + 1   17 💤 ± 0  0 ❌ ±0 
16 713 runs   - 32  16 586 ✅  - 21  127 💤  - 11  0 ❌ ±0 

Results for commit 36e43e2. ± Comparison against base commit 756e8d8.

This pull request removes 11 and adds 12 tests. Note that renamed tests count towards both.
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownFloatArray
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownInteger
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownPoint
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownRectangle
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownscaleUpPointInvertible
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleDownscaleUpRectangleInvertible
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleUpFloat
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleUpIntArray
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleUpInteger
org.eclipse.swt.tests.junit.DPIUtilTests ‑ scaleUpPoint
…
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownFloat
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownFloatArray
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownInteger
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownPoint
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownRectangle
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownscaleUpPointInvertible
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleDownscaleUpRectangleInvertible
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleUpFloat
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleUpIntArray
AllWin32Tests org.eclipse.swt.tests.win32.Win32DPIUtilTests ‑ scaleUpInteger
…

♻️ This comment has been updated with latest results.

@fedejeanne
Copy link
Contributor

fedejeanne commented Jul 4, 2025

There are quite few changes in this PR. Could you please split it into several commits so I can review better? Try to split the commits where you used automated refactorings and mention "made by using only automated refactoring 'xyz'" in the commit-text.

There are also compile errors.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-287-win32 branch 2 times, most recently from 2a71902 to 327a528 Compare July 4, 2025 12:10
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft July 4, 2025 12:12
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-287-win32 branch 2 times, most recently from 1143bb0 to c098aaf Compare July 4, 2025 12:23
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review July 7, 2025 08:35
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-287-win32 branch 2 times, most recently from 1d023e8 to 13e7915 Compare July 8, 2025 14:32
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.

I went through the commit made with the automatic refactorings. Question: was it made by using only automated refactorings? I see some unexpected changes in there.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-287-win32 branch 2 times, most recently from e940b38 to 562e5ba Compare July 9, 2025 10:32
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, thank you!

I'll merge it on Monday since I have to leave the office now.

Removing all autoScale method from DPIUtil and replace it usages with
scaleDown/Up method and pass the zoom from the caller side
This commit introduces a dedicated Win32DPIUtils class to isolate
Win32-specific DPI logic, improving platform separation and
maintainability. Refactored moving with eclipse refactoring tool.
@fedejeanne fedejeanne merged commit f8c19db into eclipse-platform:master Jul 14, 2025
17 checks passed
@fedejeanne fedejeanne deleted the master-287-win32 branch July 14, 2025 08:05
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] Move Windows-specific DPI methods to Win32
3 participants