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

 4 files   -  3 014   4 suites   - 3 014   1s ⏱️ - 2h 17m 18s
24 tests  -  8 210  24 ✅  -  7 961  0 💤  - 249  0 ❌ ±0 
48 runs   - 23 574  48 ✅  - 22 780  0 💤  - 794  0 ❌ ±0 

Results for commit b430848. ± Comparison against base commit a3fa065.

This pull request removes 8210 tests.
AllFormsTests AllEventsTests ExpansionListenerTest ‑ callsExpansionStateChangedConsumer
AllFormsTests AllEventsTests ExpansionListenerTest ‑ callsExpansionStateChangingConsumer
AllFormsTests AllEventsTests ExpansionListenerTest ‑ throwsNullPointerOnNullStateChangedAdapter
AllFormsTests AllEventsTests ExpansionListenerTest ‑ throwsNullPointerOnNullStateChangingAdapter
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ callsActivatedConsumer
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ callsEnteredConsumer
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ callsExitedConsumer
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ throwsNullPointerOnNullActivatedAdapter
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ throwsNullPointerOnNullEnteredAdapter
AllFormsTests AllEventsTests HyperLinkListenerTest ‑ throwsNullPointerOnNullExitedAdapter
…

♻️ 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 6 times, most recently from b750a92 to 9133cb5 Compare November 19, 2025 11:01
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.
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.

Comment on lines +710 to +711
MessageDialog.openError(new Shell(Display.getDefault()),
WorkbenchMessages.RescaleAtRuntimeIncompatibilityTitle,
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be deferred to when the workbench has been started, so that the dialog can be created on top of the workbench instead of creating a new shell on the default display. In particular because at this point in time the display for the workbench is not initialized yet, so this may have unintended side effects.

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