From cab3be8d8b615d48ace2a56bc7c8c74f095d85b0 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 28 Jan 2026 18:29:37 +0100 Subject: [PATCH] Ensuring AdjustWindowRectExForDpi uses consistent zoom Changed Control.adjustWindowRectEx to use getShellZoom() instead of shell.getZoom(). This ensures consistency with nativeZoom which is used by computeTrim and other layout logic, preventing the possibility of incorrect border sizing when shell.getZoom() and nativeZoom are out of sync --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index 92dbf4bc9e..36ee200967 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -6161,9 +6161,7 @@ int getSystemMetrics(int nIndex) { } boolean adjustWindowRectEx(RECT lpRect, int dwStyle, boolean bMenu, int dwExStyle) { - Shell shell = getShell(); - int zoom = shell != null ? shell.getZoom() : nativeZoom; - return OS.AdjustWindowRectExForDpi (lpRect, dwStyle, bMenu, dwExStyle, DPIUtil.mapZoomToDPI(zoom)); + return OS.AdjustWindowRectExForDpi (lpRect, dwStyle, bMenu, dwExStyle, DPIUtil.mapZoomToDPI(getShellZoom())); } private static void resizeFont(Control control, int newZoom) {