As already discussed few times on forums, Logic Pro on Silicon doesn’t always destroy editor when plugin window is closed. I don’t know why this is happening, but for example, using Big Sur and Logic 10.7, editor is deleted every other time, otherwise plugin window is just hidden. Using Ventura and Logic 10.7.8, editor is deleted every time window is closed as expected. So it’s pretty unpredictable behaviour. My guess is, that Logic decides about it depending on some system parameters or configuration, maybe there are also settings, which I am not aware of.
For example, I have this “misbehaviour” on 1 of my 3 macOS systems.
I have top-level-window component inside my plugin editor. It is added using addToDesktop() method, using my plugin editor window as a parent component. So I am creating heavy-weight window as a child of my plugin window. I need top-level-window because of technical reasons. So far so good.
topLevelWindow->addToDesktop (TopLevelWindow::getDesktopWindowStyleFlags(), getWindowHandle());
The problem no. 1
When Logic is hiding my plugin editor (not destroying it) on plugin close, this top-level-window is not restored when reopening plugin editor. Top-level-window is not destroyed as I can tell, it still exists in memory, it’s just not visible anymore. It’s worth to mention, that if I set “parent” to nullptr, top-level-window is not lost (!), but its screen position is not correct.
Now, I could solve this by checking visibility of my plugin and manually restoring missing top-level-window. Here comes …
The problem no. 2
In this particular situation, none of the JUCE methods (using version 6.1.6), which checks visibility of the component, work (including isShowing() method, which is meant to be used in situations like this). So I can’t get any relevant info about visibility of my plugin and top-level-window component. Everything seems like my plugin window and its components are is visible, but they are not! No matter what I do, I always get info that my plugin is visible. It seems, that JUCE is completely unaware of this unusual situation.
So if anyone has any slightest idea how to solve this, it would be greatly appreciated. My plugin works properly in all other hosts. True, there are some other hosts, which don’t always delete editor, but correct information about plugin visibility is always available.
Thank you!
