Skip to content

Commit 1824ac7

Browse files
akoch-yattaHeikoKlare
authored andcommitted
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 7cc858e commit 1824ac7

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
@@ -667,10 +667,12 @@ private static int getZoomForAutoscaleProperty (int nativeDeviceZoom, String aut
667667
public static void runWithAutoScaleValue(String autoScaleValue, Runnable runnable) {
668668
String initialAutoScaleValue = DPIUtil.autoScaleValue;
669669
DPIUtil.autoScaleValue = autoScaleValue;
670+
DPIUtil.deviceZoom = getZoomForAutoscaleProperty(nativeDeviceZoom);
670671
try {
671672
runnable.run();
672673
} finally {
673674
DPIUtil.autoScaleValue = initialAutoScaleValue;
675+
DPIUtil.deviceZoom = getZoomForAutoscaleProperty(nativeDeviceZoom);
674676
}
675677
}
676678

0 commit comments

Comments
 (0)