Skip to content

Commit ff25c35

Browse files
committed
[Win32] Fix shell zoom when disabling autoscaling on shell
Recent simplifications to how autoscaling can be disabled for controls leads to a wrong native zoom being reported via getData("SHELL_ZOOM") when autoscaling is disabled at the shell itself. Instead of the actual zoom it always reports 100 because the shell's nativeZoom is overwritten when autoscaling is disabled for the shell. This change adapts the way in which the shell zoom is retrieved when calling getData("SHELL_ZOOM") to be independent of the stored nativeZoom value.
1 parent ac18a18 commit ff25c35

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ public Cursor getCursor () {
12821282
public Object getData(String key) {
12831283
if (DATA_SHELL_ZOOM.equals(key)) {
12841284
Shell shell = getShell();
1285-
return shell == null ? null : shell.nativeZoom;
1285+
return shell == null ? null : DPIUtil.mapDPIToZoom(OS.GetDpiForWindow(shell.handle));
12861286
}
12871287
return super.getData(key);
12881288
}

0 commit comments

Comments
 (0)