Skip to content

Commit

Permalink
Consider changes to system property for rescaling at runtime
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HeikoKlare committed Jan 14, 2025
1 parent c49cee7 commit d7be959
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class DPIUtil {
private static enum AutoScaleMethod { AUTO, NEAREST, SMOOTH }
private static AutoScaleMethod autoScaleMethodSetting = AutoScaleMethod.AUTO;
private static AutoScaleMethod autoScaleMethod = AutoScaleMethod.NEAREST;
private static boolean autoScaleOnRuntime = false;

private static String autoScaleValue;
private static boolean useCairoAutoScale = false;
Expand Down Expand Up @@ -109,9 +108,6 @@ private static enum AutoScaleMethod { AUTO, NEAREST, SMOOTH }
autoScaleMethod = autoScaleMethodSetting = AutoScaleMethod.SMOOTH;
}
}

String updateOnRuntimeValue = System.getProperty (SWT_AUTOSCALE_UPDATE_ON_RUNTIME);
autoScaleOnRuntime = Boolean.parseBoolean(updateOnRuntimeValue);
}

/**
Expand Down Expand Up @@ -655,7 +651,8 @@ public static int getZoomForAutoscaleProperty (int nativeDeviceZoom) {
}

public static boolean isAutoScaleOnRuntimeActive() {
return autoScaleOnRuntime;
boolean updateOnRuntimeValue = Boolean.getBoolean (SWT_AUTOSCALE_UPDATE_ON_RUNTIME);
return updateOnRuntimeValue;
}

/**
Expand Down

0 comments on commit d7be959

Please sign in to comment.