From 552167f94e4a8bc4126995e3a7d713b9ff9b13b6 Mon Sep 17 00:00:00 2001 From: Andreas Koch Date: Fri, 11 Oct 2024 08:35:55 +0200 Subject: [PATCH] [win32] Fix initialization of thread dpi awareness This commit moves the initialization of the thread DPI awareness into the creation method. It was done too late before which resulted in all calls do Display::messageProc being executed with the wrong DPI awarness of the thread dpi awareness differs from the process DPI awareness. Contributes to #62 and #131 --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java index e15a12409e..4f769c4416 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java @@ -583,9 +583,6 @@ public Display () { */ public Display (DeviceData data) { super (data); - if (DPIUtil.isAutoScaleOnRuntimeActive()) { - setRescalingAtRuntime(true); - } } Control _getFocusControl () { @@ -939,6 +936,9 @@ public void close () { protected void create (DeviceData data) { checkSubclass (); checkDisplay (thread = Thread.currentThread (), true); + if (DPIUtil.isAutoScaleOnRuntimeActive()) { + setRescalingAtRuntime(true); + } createDisplay (data); register (this); if (Default == null) Default = this;