1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

VST Host: Avoid resizing plugin views directly on Windows

Previously, plugin views may be set to unexpected sizes by the host,
which could interrupt size updates due to scale factor changes. This
could leave the plugin view at an incorrect size.
This commit is contained in:
reuk 2021-07-28 19:25:08 +01:00
parent e7d608aa48
commit 5ea5afbd2a
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -2898,23 +2898,24 @@ public:
{
const ScopedValueSetter<bool> recursiveResizeSetter (recursiveResize, true);
const auto editorSize = plugin.getEditorSize();
const auto pos = (peer->getAreaCoveredBy (*this).toFloat() * nativeScaleFactor).toNearestInt();
#if JUCE_WINDOWS
if (pluginHWND != 0)
{
ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND };
MoveWindow (pluginHWND,
pos.getX(),
pos.getY(),
editorSize.getWidth(),
editorSize.getHeight(),
TRUE);
SetWindowPos (pluginHWND,
HWND_BOTTOM,
pos.getX(),
pos.getY(),
0,
0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
}
#elif JUCE_LINUX || JUCE_BSD
if (pluginWindow != 0)
{
const auto editorSize = plugin.getEditorSize();
auto* symbols = X11Symbols::getInstance();
symbols->xMoveResizeWindow (display,
pluginWindow,