From 7b68d5fa4be18a24718c8c7bd2d54e26f63cb74b Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 5 Mar 2021 18:03:31 +0000 Subject: [PATCH] VST: Increased the scoped of a thread DPI awareness setter when creating plug-in editors on Windows --- .../format_types/juce_VSTPluginFormat.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index fcfd9c3d73..bcc1e3d884 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -3110,7 +3110,12 @@ private: JUCE_END_IGNORE_WARNINGS_MSVC RECT r; - GetWindowRect (pluginHWND, &r); + + { + ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND }; + GetWindowRect (pluginHWND, &r); + } + auto w = (int) (r.right - r.left); auto h = (int) (r.bottom - r.top);