From ae4f8126c52dde1d1d948f621f2c0b56a6d45342 Mon Sep 17 00:00:00 2001 From: Amartya Parijat Date: Mon, 22 Dec 2025 15:28:45 +0100 Subject: [PATCH] Make DPIChangeExecution execute with a higher priority This commit introduces the usage of a separate thread to start processing the DPI Change events by executing the handlers using Display#syncExec to provide higher priority to the DPIChangeExecuting tasks. --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 59ba774fc4..0b2b6831e9 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 @@ -16,6 +16,7 @@ import java.util.*; +import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.stream.*; @@ -5982,6 +5983,7 @@ LRESULT wmScrollChild (long wParam, long lParam) { static class DPIChangeExecution { AtomicInteger taskCount = new AtomicInteger(); private boolean asyncExec = true; + ExecutorService executor = Executors.newSingleThreadExecutor(); private void process(Control control, Runnable operation) { boolean currentAsyncExec = asyncExec; @@ -5992,7 +5994,9 @@ private void process(Control control, Runnable operation) { asyncExec &= (comp.layout != null); } if (asyncExec) { - control.getDisplay().asyncExec(operation::run); + executor.submit(() -> { + control.getDisplay().syncExec(operation::run); + }); } else { operation.run(); }