Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ public final class Workbench extends EventManager implements IWorkbench, org.ecl

private static final String EDGE_USER_DATA_FOLDER = "org.eclipse.swt.internal.win32.Edge.userDataFolder"; //$NON-NLS-1$

private static final String SWT_RESCALE_AT_RUNTIME_PROPERTY = "swt.autoScale.updateOnRuntime"; //$NON-NLS-1$

private static final class StartupProgressBundleListener implements ServiceListener {

private final SubMonitor subMonitor;
Expand Down Expand Up @@ -586,7 +588,7 @@ public static int createAndRunWorkbench(final Display display, final WorkbenchAd
int orientation = store.getInt(IPreferenceConstants.LAYOUT_DIRECTION);
Window.setDefaultOrientation(orientation);
}
setRescaleAtRuntimePropertyFromPreference(display);
setRescaleAtRuntimePropertyFromPreference();
if (obj instanceof E4Application) {
E4Application e4app = (E4Application) obj;
E4Workbench e4Workbench = e4app.createE4Workbench(getApplicationContext(), display);
Expand Down Expand Up @@ -680,12 +682,15 @@ public void update() {
return returnCode[0];
}

private static void setRescaleAtRuntimePropertyFromPreference(final Display display) {
boolean rescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
if (rescaleAtRuntime) {
display.setRescalingAtRuntime(rescaleAtRuntime);
System.setProperty("org.eclipse.swt.browser.DefaultType", "edge"); //$NON-NLS-1$ //$NON-NLS-2$
private static void setRescaleAtRuntimePropertyFromPreference() {
if (System.getProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY) != null) {
WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, SWT_RESCALE_AT_RUNTIME_PROPERTY
+ " is configured (e.g., via the INI), but the according preference should be preferred instead.", //$NON-NLS-1$
new RuntimeException()));
} else {
boolean rescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
System.setProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY, Boolean.toString(rescaleAtRuntime));
}
}

Expand Down
Loading