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:
parent
e7d608aa48
commit
5ea5afbd2a
1 changed files with 8 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue