Skip to content

Commit e314e02

Browse files
committed
Avoid access to default scope on read of configuration scope preference
The configuration scope preference for monitor-specific scaling is read at a point in time where the workspace location may not have been defined, so that the instance scope preferences cannot be accessed yet. Since some defaults initializers require access to the instance scope, the access to the configuration scope preference must avoid access to the default scope in case no explicit value is set for that preference yet. This change adapts the access to the monitor-specific scaling configuration scope preference to not access the default scope. Since there may be further preference defaults initializers out of our control that access instance scope preferences, just adapting those in the Platform would not be a sufficient solution alternative. Fixes #4085
1 parent 8a0d043 commit e314e02

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
import org.eclipse.ui.menus.IMenuService;
255255
import org.eclipse.ui.model.IContributionService;
256256
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
257-
import org.eclipse.ui.preferences.ScopedPreferenceStore;
258257
import org.eclipse.ui.progress.IProgressService;
259258
import org.eclipse.ui.progress.WorkbenchJob;
260259
import org.eclipse.ui.services.IDisposable;
@@ -3748,8 +3747,8 @@ public void setRescaleAtRuntimePropertyFromPreference() {
37483747
+ " is configured (e.g., via the INI), but the according preference should be preferred instead." //$NON-NLS-1$
37493748
));
37503749
} else {
3751-
boolean rescaleAtRuntime = new ScopedPreferenceStore(ConfigurationScope.INSTANCE,
3752-
WorkbenchPlugin.PI_WORKBENCH).getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
3750+
boolean rescaleAtRuntime = ConfigurationScope.INSTANCE.getNode(WorkbenchPlugin.PI_WORKBENCH)
3751+
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
37533752
System.setProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY, Boolean.toString(rescaleAtRuntime));
37543753
}
37553754

0 commit comments

Comments
 (0)