From 6c4bd613b8f4b4611e1e6700d2b096bf38117249 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Tue, 20 May 2025 10:31:52 +0200 Subject: [PATCH] [win32] Adjust wrong size after DPI fix in Shell This commit addresses an issue with the logic fixing a missing DPI change event from windows in the Shell#WM_WINDOWPOSCHANGED callback. It is no longer necessary, because the causing issue is that in some scenarios a sub shell is positioned on a random monitor. Solution is to adapt the nativeZoom of the sub Shell after the handle was created. --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java index 6cb9cf52dd9..c6bc6bb456f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java @@ -553,6 +553,14 @@ public void close () { closeWidget (); } +@Override +void createWidget() { + super.createWidget (); + if (parent != null) { + this.nativeZoom = DPIUtil.mapDPIToZoom(OS.GetDpiForWindow(handle)); + } +} + void createBalloonTipHandle () { balloonTipHandle = OS.CreateWindowEx ( 0,