setContentOwned (new PluginComponent (editor), true);
It works fine for almost all plug-in manufacturers except one that I’ve tested… in that case the first time the Window is displayed it draws the VST2 AudioProcessorEditor, but if I close and re-open the Window the plug-in area is black.
Stepping though the code I don’t see anything wrong… and if I load a VST3 version of the plug-in it always draws correctly.
Any thoughts on why the VST2 when embedded in a “parent” Component will not repaint (for a particular plug-in)… but when not embedded in another Component paints fine?
Hmmmm that’s really strange. I can’t really see any difference between using your PluginComponent or not. Are you sure that the editor is being properly released when using your PluginComponent? Maybe you are re-creating the editor with the old one still hanging around?
No, that would occur then without the PluginComponent as well… Since it only happens with FabFilter plug-ins… they must be using some OpenGL threading which is using CVDisplayLink… which is causing a problem. I checked the pEditor values in the debugger… and they seemed fine.
I’m looking at creating my plug-in header bar using setMenuBarComponent as a kludge instead… but I don’t see a parameter in setMenuBarComponent to set newMenuBarHeight and it doesn’t get the height from the Component.
I didn’t think I could use a custom Component for that using the MenuBarModel… I’ll dig in deeper… This isn’t going to really be a “menu”… but it’ll have a Preset ComboBox, and 4 buttons which I’ll use to interact directly with the AudioProcessor.
Hmmm, Jules and I don’t really like this suggestion as it’s the parent’s component responsibility to resize the menuBar component. For example, the default menuBar component has a size of zero by default. For example, I would expect the following to work:
documentWindow.setMenuBarComponent (new MenuBarComponent (myMenuBar));
But with your change the menuBarHeight would be zero (as the default height of MenuBarComponent is zero). It might be better to add a default argument to setMenuBarComponent to override the menuBarHeight?