From 1b7dd32f71456fc86db5f43035c1a3f8a160ca88 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Tue, 14 Oct 2025 16:19:36 +0200 Subject: [PATCH] [win32] Always reset cached current DPIChangeEvent This commit ensures to always reset the currently cached DPIChangeEvent of a Control properly. Otherwise spawning dpi change events for multiple Controls that are related via parent->child hierarchy could lead to a currentDpiChangeEvent of the parent being canceled by the creation of the event of the child. Contributes to https://github.com/eclipse-platform/eclipse.platform.swt/issues/2608 --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 6 +++--- 1 file changed, 3 insertions(+), 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 bcfd141fe0d..e6e4d7d6679 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 @@ -5940,13 +5940,13 @@ void sendZoomChangedEvent(Event event, Shell shell) { notifyListeners(SWT.ZoomChanged, event); } } finally { + if (event == currentDpiChangeEvent) { + currentDpiChangeEvent = null; + } if (shell.isDisposed()) { return; } if (dpiExecData.decrement()) { - if (event == currentDpiChangeEvent) { - currentDpiChangeEvent = null; - } if (event.doit) { shell.WM_SIZE(0, 0); }