Skip to content

Commit ba0696a

Browse files
Initialize nativeZoom from Shell via OS call
Shell can be created on secondary monitor but inheriting the zoom of parent (which could be on primary monitor) means the DPI change will not be triggered.
1 parent a3174e7 commit ba0696a

File tree

1 file changed

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

1 file changed

+1
-10
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,9 @@ public Shell (Display display, int style) {
300300
if (handle != 0 && !embedded) {
301301
state |= FOREIGN_HANDLE;
302302
}
303-
304-
int shellNativeZoom;
305-
if (parent != null) {
306-
shellNativeZoom = parent.nativeZoom;
307-
} else {
308-
int mappedDPIZoom = getMonitor().getZoom();
309-
shellNativeZoom = mappedDPIZoom;
310-
}
311-
this.nativeZoom = shellNativeZoom;
312-
313303
reskinWidget();
314304
createWidget ();
305+
this.nativeZoom = DPIUtil.mapDPIToZoom(OS.GetDpiForWindow(this.handle));
315306
}
316307

317308
/**

0 commit comments

Comments
 (0)