Skip to content

Commit 55892dc

Browse files
committed
Correct activation of monitor-specific rescaling on Windows
The activation of monitor-specific rescaling on Windows currently relies on the method Display#setRescalingAtRuntime(), which was found to not take the full intended effect. This change thus replaces the call to that method based on the value of the according experimental preference by setting the according system property to activate that behavior in a proper way. It also removes the obsolete activation of Edge when the experimental preference is set, as Edge has been enabled by default.
1 parent f9feca4 commit 55892dc

File tree

1 file changed

+9
-5
lines changed
  • bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal

1 file changed

+9
-5
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public static int createAndRunWorkbench(final Display display, final WorkbenchAd
586586
int orientation = store.getInt(IPreferenceConstants.LAYOUT_DIRECTION);
587587
Window.setDefaultOrientation(orientation);
588588
}
589-
setRescaleAtRuntimePropertyFromPreference(display);
589+
setRescaleAtRuntimePropertyFromPreference();
590590
if (obj instanceof E4Application) {
591591
E4Application e4app = (E4Application) obj;
592592
E4Workbench e4Workbench = e4app.createE4Workbench(getApplicationContext(), display);
@@ -680,12 +680,16 @@ public void update() {
680680
return returnCode[0];
681681
}
682682

683-
private static void setRescaleAtRuntimePropertyFromPreference(final Display display) {
683+
private static void setRescaleAtRuntimePropertyFromPreference() {
684+
final String rescaleAtRuntimeProperty = "swt.autoScale.updateOnRuntime"; //$NON-NLS-1$
684685
boolean rescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
685686
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
686-
if (rescaleAtRuntime) {
687-
display.setRescalingAtRuntime(rescaleAtRuntime);
688-
System.setProperty("org.eclipse.swt.browser.DefaultType", "edge"); //$NON-NLS-1$ //$NON-NLS-2$
687+
if (System.getProperty(rescaleAtRuntimeProperty) != null) {
688+
WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING,
689+
rescaleAtRuntimeProperty + " is configured (e.g., via the INI), but the according preference should be preferred instead.", //$NON-NLS-1$
690+
new RuntimeException()));
691+
} else {
692+
System.setProperty("swt.autoScale.updateOnRuntime", Boolean.toString(rescaleAtRuntime)); //$NON-NLS-1$
689693
}
690694
}
691695

0 commit comments

Comments
 (0)