Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim commented Oct 30, 2025

Workbench needs few methods from DPIUtil that were only present for Win32. Keeping the functionality for Win32DPIUtil as is, just making them available for DPIUtil.

Also removing the test that test some numeric autoscale value with monitor-specific scaling which is now not allowed.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Test Results

  118 files  ±0    118 suites  ±0   18m 40s ⏱️ +6s
4 649 tests  - 3  4 631 ✅  - 4  18 💤 +1  0 ❌ ±0 
  335 runs   - 3    331 ✅  - 3   4 💤 ±0  0 ❌ ±0 

Results for commit fadc48c. ± Comparison against base commit bcd5988.

This pull request removes 3 tests.
org.eclipse.swt.widgets.ControlWin32Tests ‑ testAutoScaleImageData(float, String, boolean)[6]
org.eclipse.swt.widgets.ControlWin32Tests ‑ testAutoScaleImageData(float, String, boolean)[7]
org.eclipse.swt.widgets.ControlWin32Tests ‑ testAutoScaleImageData(float, String, boolean)[8]
This pull request skips 1 test.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser_IE ‑ test_setUrl_remote_with_post

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare 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 be in favor of doing such a change more incrementally. Obviously, there is code in Platform UI depending on (internal) methods of DPIUtil. Moving them to another class means that Platform UI code becomes incompatible once we merge the SWT PR and if we merge the Platform UI PR at the same time (without knowing if it works as the CI will fail) will make Platform UI builds fail until the next I-Build.

Thus, in such a case a multi-step transition should be made by refactoring and maybe adding methods while still keeping the old ones (as delegates), then adapt the consumers (such as Platform UI) and once that is done remove the delegates that became obsolete.

It also seems like the AutoScaling class and DPIUtil would be highly mutually dependent. This could be an indicator that splitting them up is not a good idea. In any case, AutoScaling seems like it disposes much new public API that we will tie ourselves to. I know that I proposed to make some its functionality API, but seeing it I am not so sure anymore whether we should really do it or better keep it internal (like with DPIUtil) and access the internal API from Platform UI for now. At least, whatever we make public should be as lean as possible and in my opinion we should definitely not make something like an autoscale mode publicly accessible.

@ShahzaibIbrahim ShahzaibIbrahim changed the title [Refactor] Move autoscaling methods in AutoScaling class [Refactor] Moving methods from Win32DPIUtil to DPIUtil for autoscaling Oct 31, 2025
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-399 branch 2 times, most recently from 7df9a79 to 08dcd65 Compare October 31, 2025 13:01
@ShahzaibIbrahim
Copy link
Contributor Author

As suggested, I have kept the methods in DPIUtil class. This PR now only moves few of the method in DPIUtil as these will be required to me in the workbench for subsequent PR: eclipse-platform/eclipse.platform.ui#3475.

The idea is to limit monitor specific for both SWT and eclipse products with compatible autoscaling methods.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-399 branch 4 times, most recently from 50b09f6 to bed297b Compare October 31, 2025 13:46
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft October 31, 2025 13:51
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review October 31, 2025 14:55
Workbench needs few methods from DPIUtil that were only present for
Win32. Keeping the functionality for Win32DPIUtil as is, just making
them available for DPIUtil.
return false;
}

public static boolean isMonitorSpecificScalingActive() {
Copy link
Contributor

@HeikoKlare HeikoKlare Nov 11, 2025

Choose a reason for hiding this comment

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

Why not remove this method as it's now part of DPIUtil anyway?

String value = autoScaleValue.toLowerCase(Locale.ROOT);

// Compatible only if one of the known values
return ALLOWED_AUTOSCALE_VALUES_FOR_UPDATE_ON_RUNTIME.contains(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes the proposed change not a refactoring but will actually further restrict the supported auto-scale modes. To keep this a refactoring that behavioral change should be reverted. The same is indicated by the need to modify a test.

@HeikoKlare
Copy link
Contributor

@akurtakov this PR is not yet ready to be merged, but at least your specific request for changes was resolved, wasn't it?

@akurtakov akurtakov dismissed their stale review November 11, 2025 17:24

My concern has been adressed.

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.

Limit monitor-specific scaling to supported autoscale modes

3 participants