Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

A new utility solely responsible for taking care of autoscaling methods. Also introduced new system property swt.autoScale.force that can be set to true in order to disable the compatibility error for setting the autoscale value when update on runtime is enabled.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Test Results

  118 files  ±0    118 suites  ±0   14m 56s ⏱️ - 1m 26s
4 650 tests ±0  4 633 ✅ ±0  17 💤 ±0  0 ❌ ±0 
  330 runs  ±0    326 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit 31f1b58. ± Comparison against base commit 079d2a9.

♻️ This comment has been updated with latest results.

/**
* Utility for checking and enabling monitor-specific auto scaling.
* @since 3.132
*/
Copy link
Member

Choose a reason for hiding this comment

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

So you want this to be exported as API? If that's the case, make sure that every visible method in it is properly named and documented.

A new utility solely responsible for taking care of autoscaling methods.
Also introduced new system property swt.autoScale.force that can be set
to true in order to disable the compatibility error for setting the
autoscale value when update on runtime is enabled.
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review October 30, 2025 14:47
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.

static {
autoScaleValue = System.getProperty (SWT_AUTOSCALE);
}
private static final Set<String> ALLOWED_VALUES = Set.of("false", "quarter", "exact");
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion, we should even remove the "false" option. And the variable should have a more specific name, as is's unclear for what these values are allowed.

Suggested change
private static final Set<String> ALLOWED_VALUES = Set.of("false", "quarter", "exact");
private static final Set<String> ALLOWED_AUTOSCALE_VALUES_FOR_UPDATE_ON_RUNTIME = Set.of("quarter", "exact");

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