where the initial editor size is set to 1 x 1… and on MacOS in juce_VSTPluginFormat.cpp it calls openPluginWindow() where the window size is determined… but on Windows there’s no visibilityChanged() method so the editor size remains at 1 x 1
#if JUCE_MAC
void visibilityChanged() override
{
if (cocoaWrapper != nullptr)
{
if (isVisible())
openPluginWindow ((NSView*) cocoaWrapper->getView());
else
closePluginWindow();
}
}
void childBoundsChanged (Component*) override
{
if (cocoaWrapper != nullptr)
{
auto w = cocoaWrapper->getWidth();
auto h = cocoaWrapper->getHeight();
if (w != getWidth() || h != getHeight())
setSize (w, h);
}
}
#endif
Do you think this should be changed in the wrapper – or should I figure out the Editor size myself?
The new commits for Windows scaling have changed the behavior for VST3 plug-ins so now the bounds aren’t returned correctly until much later… if you can please remove the JUCE_MAC guard check around line 1122 in juce_VST3PluginFormat.cpp then we get equity between both platforms.
Hey @Rail_Jon_Rogut - sorry for the delay, this post slipped under the radar somehow.
Removing the #if JUCE_MAC guard in the VST3 hosting code seems sensible and it’d be good to get parity between platforms. As for your suggested change for the VST2 hosting classes however, I’m hesitant to add another method to AudioProcessorEditor's interface, especially one which is only really implemented for one specific case. Instead, adding this to the end of the VSTPluginWindow constructor:
does the same thing and ensures that calling getBounds() will return the correct size before setContentOwned() is called. However, my concern is that the setSize (1, 1); call is there for a reason and this change could break things - I’ve tested with a few plug-ins in the AudioPluginHost and it seems to work OK but I can’t be 100% sure.
In any case I’d like to give both of these changes a long test before they go onto the master branch as there could be some tricky edge cases that we haven’t anticipated. We’ve got a release coming up fairly soon so it’ll have to wait until after that before I put these changes on the develop branch.