diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java index 06804718372..fe91ef5a8c5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java @@ -79,10 +79,9 @@ private static enum AutoScaleMethod { AUTO, NEAREST, SMOOTH } *
  • "nearest": nearest-neighbor interpolation, may look jagged
  • *
  • "smooth": smooth edges, may look blurry
  • * - * The current default is to use "nearest", except on - * GTK when the deviceZoom is not an integer multiple of 100%. - * The smooth strategy currently doesn't work on Win32 and Cocoa, see - * bug 493455. + * The current default is to use "smooth" on GTK when deviceZoom is an integer + * multiple of 100% and on Windows if monitor-specific scaling is enabled, and + * "nearest" otherwise.. */ private static final String SWT_AUTOSCALE_METHOD = "swt.autoScale.method"; @@ -605,14 +604,22 @@ public static void setDeviceZoom (int nativeDeviceZoom) { DPIUtil.deviceZoom = deviceZoom; System.setProperty("org.eclipse.swt.internal.deviceZoom", Integer.toString(deviceZoom)); if (deviceZoom != 100 && autoScaleMethodSetting == AutoScaleMethod.AUTO) { - if (deviceZoom / 100 * 100 == deviceZoom || !"gtk".equals(SWT.getPlatform())) { - autoScaleMethod = AutoScaleMethod.NEAREST; - } else { + if (sholdUseSmoothScaling()) { autoScaleMethod = AutoScaleMethod.SMOOTH; + } else { + autoScaleMethod = AutoScaleMethod.NEAREST; } } } +private static boolean sholdUseSmoothScaling() { + return switch (SWT.getPlatform()) { + case "gtk" -> deviceZoom / 100 * 100 != deviceZoom; + case "win32" -> isMonitorSpecificScalingActive(); + default -> false; + }; +} + public static void setUseCairoAutoScale (boolean cairoAutoScale) { useCairoAutoScale = cairoAutoScale; }