From 8dace1dcbfe1ad4dec23bd3eee6a40fdaeac7645 Mon Sep 17 00:00:00 2001 From: fedejeanne Date: Thu, 6 Feb 2025 15:27:43 +0100 Subject: [PATCH] Use smooth scaling on Windows if monitor-specific UI scaling is active Do not change the logic for Linux: coming back to 100% monitor stays in the current mode. Co-authored-by: Heiko Klare --- .../Eclipse SWT/common/org/eclipse/swt/internal/DPIUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 fe91ef5a8c5..880d0c3544a 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 @@ -603,7 +603,10 @@ 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) { + + // in GTK, preserve the current method when switching to a 100% monitor + boolean preserveScalingMethod = SWT.getPlatform().equals("gtk") && deviceZoom == 100; + if (!preserveScalingMethod && autoScaleMethodSetting == AutoScaleMethod.AUTO) { if (sholdUseSmoothScaling()) { autoScaleMethod = AutoScaleMethod.SMOOTH; } else {