Skip to content

Conversation

@ShahzaibIbrahim
Copy link
Contributor

@ShahzaibIbrahim ShahzaibIbrahim commented Oct 30, 2025

These changes have following affects:

  • Upon starting eclipse product when monitor-specific scaling is set with unsupported autoscale mode, it will show a error dialog and application won't start.
  • User won't be able to enable monitor-specific scaling from appearance page if unsupported autoscale mode is set from property or ini file.
  • User can then either force the unsupported autoscale mode with monitor specific-scaling by setting swt.autoScale.force to true or switch to supported autoscale mode.

Testing


Scenario#1: Starting application with -Dswt.autoScale=int200

Result: App should start (if monitor-specific scaling is not checked in Appearance page), but option to turn on monitor-specific scaling in Appearance page should be disabled.

image

Scenario#2: Starting application with -Dswt.autoScale=int200 and -Dswt.autoScale.updateOnRuntime=true

Result: App will start, user will see an error dialog stating the incompatibility of an option and monitor specific-scaling will be disabled.

image

Scenario#3: Starting application with -Dswt.autoScale=int200 and -Dswt.autoScale.updateOnRuntime=true
and -Dswt.autoScale.force=true

Result: makes more sense with swt applications. if user really wants to use other scaling mode with monitor-specific scaling.

import org.eclipse.swt.widgets.*;

public class AutoScaleSnippet {

public static void main (String [] args) {
	System.setProperty("swt.autoScale.updateOnRuntime", "true");
	System.setProperty("swt.autoScale", "int200");
	System.setProperty("swt.autoScale.force", "true");
	Display display = new Display ();
	Shell shell = new Shell(display);
	shell.setText("Autoscale snippet");
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}

Scenario#4: Starting application with -Dswt.autoScale=quarter

Result: App should start, and user should be able to turn on/off the monitor-specific scaling in Appearance page.

image

Note: following is the list of allowed autoscale values to be paired with monitor-specific scaling: ["false", "quarter", "exact"] or any concrete zoom value e.g. 225

Dependency

@github-actions
Copy link
Contributor

github-actions bot commented Oct 30, 2025

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 14m 33s ⏱️ - 2m 48s
 8 242 tests ±0   7 994 ✅ ±0  248 💤 ±0  0 ❌ ±0 
23 646 runs  ±0  22 855 ✅ ±0  791 💤 ±0  0 ❌ ±0 

Results for commit 939256f. ± Comparison against base commit 2a814c8.

♻️ This comment has been updated with latest results.

@ShahzaibIbrahim
Copy link
Contributor Author

Test failures are due to dependent PR: eclipse-platform/eclipse.platform.swt#2709 not being merged yet.

@HeikoKlare HeikoKlare force-pushed the master-399 branch 2 times, most recently from e03b834 to 3ca1192 Compare November 14, 2025 12:24
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-399 branch 2 times, most recently from 3e07a44 to ed384a1 Compare November 17, 2025 11:01
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review November 17, 2025 11:01
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-399 branch 7 times, most recently from 9133cb5 to b430848 Compare November 19, 2025 11:01
Copy link
Contributor

@amartya4256 amartya4256 left a comment

Choose a reason for hiding this comment

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

I have tested the PR and it seems good to me. Approving.

@HeikoKlare
Copy link
Contributor

The many test failures seem to be because actually the DPIUtil#isSetupCompatibleToMonitorSpecificScaling() implementation is currently wrong. It erroneously considers the default autoScale value as incompatible:
https://github.com/eclipse-platform/eclipse.platform.swt/blob/407cb9a1672e429a9ea3272e74bc5588b90e3f12/bundles/org.eclipse.swt/Eclipse%20SWT/common/org/eclipse/swt/internal/DPIUtil.java#L142-L145

That will be implicitly fixed with:

For that reason, I propose to process that PR first. I wanted to merge it after this one to avoid that a consumer with a to-be-made-incompatible swt.autoScale value will not see the application start anymore instead of gracefully dealing with the situation as implemented in this PR, but given that's it will be integrated with just one day of delay and hopefully no up-to-date I-Build consumers use such outdated autoscale configurations anyway, it's probably okay to do it like that.

With these changes, Eclipse applications will not fail to start anymore
when an swt.autoScale value that is incompatible to monitor-specific
scaling on Windows is set.

The following changes are implemented:

- Upon starting an Eclipse application with an swt.autoScale setting that is not compatible with monitor-specific scaling on Windows, the monitor-specific scaling will be disabled and an error dialog will be shown
- Users won't be able to enable monitor-specific scaling from appearance page if unsupported swt.autoScale mode is set via system property / ini file
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 have squashed the commits and adapted the commit message to only reflect the changes to Platform UI and not the ones to SWT.

@HeikoKlare HeikoKlare merged commit e15e9bf into eclipse-platform:master Dec 9, 2025
18 checks passed
@HeikoKlare HeikoKlare deleted the master-399 branch December 9, 2025 15:24
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