Plugin resizing in Audacity

Hello everyone!

I’m trying to create an audio plugin. From a UI perspective, the user should be able to choose between some predefined sizes for the plugin (e.g. small, medium, large). To test this behavior, I created a juce::ComboBox, added three items and implemented the ComboBox::comboBoxChanged() callback inside the PluginEditor as follows:

auto val = combo.getSelectedId();
if (val == 1)          // small
    this->setSize(200, 200);

This works perfectly well on most DAWs I tested with, except for the Audacity. In Audacity and only for MacOS, resizing the plugin results to the plugin being misplaced inside its window and thus, being cropped. An example of this can be seen at the end of the post.

I tried several things, including playing with AudioProcessorEditor::setResizable() and ::resizeLimits() or replacing the setSize() calls with setBounds(), but nothing worked. Debugging the resize behavior didn’t reveal anything strange from the plugin side, either.

Is there anyone familiar with this issue? Is there any known workaround for this? Any help would be very appreciated! Thank you in advance and sorry for the lengthy post.

Examples (small size: 200 x 200, medium size: 300 x 300):