Browse Source

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.
v6.1.6
reuk 4 years ago
parent
commit
5ea5afbd2a
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp

+ 8
- 7
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -2898,23 +2898,24 @@ public:
{ {
const ScopedValueSetter<bool> recursiveResizeSetter (recursiveResize, true); const ScopedValueSetter<bool> recursiveResizeSetter (recursiveResize, true);
const auto editorSize = plugin.getEditorSize();
const auto pos = (peer->getAreaCoveredBy (*this).toFloat() * nativeScaleFactor).toNearestInt(); const auto pos = (peer->getAreaCoveredBy (*this).toFloat() * nativeScaleFactor).toNearestInt();
#if JUCE_WINDOWS #if JUCE_WINDOWS
if (pluginHWND != 0) if (pluginHWND != 0)
{ {
ScopedThreadDPIAwarenessSetter threadDpiAwarenessSetter { pluginHWND }; 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 #elif JUCE_LINUX || JUCE_BSD
if (pluginWindow != 0) if (pluginWindow != 0)
{ {
const auto editorSize = plugin.getEditorSize();
auto* symbols = X11Symbols::getInstance(); auto* symbols = X11Symbols::getInstance();
symbols->xMoveResizeWindow (display, symbols->xMoveResizeWindow (display,
pluginWindow, pluginWindow,


Loading…
Cancel
Save