Skip to content

Commit d7be959

Browse files
committed
Consider changes to system property for rescaling at runtime
The Windows-specific system property for activating monitor-specific scaling (or "rescaling at runtime") is currently only evaluated at application startup. With this change the property will be evaluated on every access, thus allowing to change the property at runtime.
1 parent c49cee7 commit d7be959

File tree

1 file changed

+2
-5
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal

1 file changed

+2
-5
lines changed

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public class DPIUtil {
4545
private static enum AutoScaleMethod { AUTO, NEAREST, SMOOTH }
4646
private static AutoScaleMethod autoScaleMethodSetting = AutoScaleMethod.AUTO;
4747
private static AutoScaleMethod autoScaleMethod = AutoScaleMethod.NEAREST;
48-
private static boolean autoScaleOnRuntime = false;
4948

5049
private static String autoScaleValue;
5150
private static boolean useCairoAutoScale = false;
@@ -109,9 +108,6 @@ private static enum AutoScaleMethod { AUTO, NEAREST, SMOOTH }
109108
autoScaleMethod = autoScaleMethodSetting = AutoScaleMethod.SMOOTH;
110109
}
111110
}
112-
113-
String updateOnRuntimeValue = System.getProperty (SWT_AUTOSCALE_UPDATE_ON_RUNTIME);
114-
autoScaleOnRuntime = Boolean.parseBoolean(updateOnRuntimeValue);
115111
}
116112

117113
/**
@@ -655,7 +651,8 @@ public static int getZoomForAutoscaleProperty (int nativeDeviceZoom) {
655651
}
656652

657653
public static boolean isAutoScaleOnRuntimeActive() {
658-
return autoScaleOnRuntime;
654+
boolean updateOnRuntimeValue = Boolean.getBoolean (SWT_AUTOSCALE_UPDATE_ON_RUNTIME);
655+
return updateOnRuntimeValue;
659656
}
660657

661658
/**

0 commit comments

Comments
 (0)