Skip to content

Commit 0d599f2

Browse files
committed
Fix for runWithAutoScaleValue
This commit addresses and issue with DPIUtil#runWithAutoScaleValue. It only adapted DPIUtil#autoScaleValue temporarily. As DPIUtil#deviceZoom is directly affected by autoScaleValue, it is important to adjust it temporarily as well. fixes eclipse-platform/eclipse.platform.ui#2897
1 parent 111b874 commit 0d599f2

File tree

1 file changed

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

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,12 @@ private static int getZoomForAutoscaleProperty (int nativeDeviceZoom, String aut
671671
public static void runWithAutoScaleValue(String autoScaleValue, Runnable runnable) {
672672
String initialAutoScaleValue = DPIUtil.autoScaleValue;
673673
DPIUtil.autoScaleValue = autoScaleValue;
674+
DPIUtil.deviceZoom = getZoomForAutoscaleProperty(nativeDeviceZoom);
674675
try {
675676
runnable.run();
676677
} finally {
677678
DPIUtil.autoScaleValue = initialAutoScaleValue;
679+
DPIUtil.deviceZoom = getZoomForAutoscaleProperty(nativeDeviceZoom);
678680
}
679681
}
680682

0 commit comments

Comments
 (0)