Skip to content

Commit fb71f1f

Browse files
committed
Make DPIUtil#isMonitorSpecificScalingActive() yield true only on Windows
Currently, DPIUtil#isMonitorSpecificScalingActive() returns true if the according system property has an appropriate value. However, monitor-specific scaling will effectively never be active when using Linux or MacOS, as it is only implemented for Windows. Returning "true" on a non-supported platform is inconsistent and puts the burden to take into account if the OS is supported at all to the consumers. This change thus adapts the method to always return "false" on non-supported platforms. This also conforms to the documentation of the system property in the DPIUtil class.
1 parent 55767d5 commit fb71f1f

File tree

1 file changed

+3
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ public static boolean isSetupCompatibleToMonitorSpecificScaling() {
155155
}
156156

157157
public static boolean isMonitorSpecificScalingActive() {
158+
if (!"win32".equals(SWT.getPlatform())) {
159+
return false;
160+
}
158161
String updateOnRuntimeValue = System.getProperty(SWT_AUTOSCALE_UPDATE_ON_RUNTIME);
159162
return "force".equalsIgnoreCase(updateOnRuntimeValue) || "true".equalsIgnoreCase(updateOnRuntimeValue);
160163
}

0 commit comments

Comments
 (0)