Issue when adding a menu to PluginWindow in AudioPluginHost

I have added a menu to the PluginWindow class in the JUCE AudioPluginHost project (latest master V8.0.13).
I created a MenuBarModel and added it to the PluginWindow using setMenuBar().
This generally works as expected, but there is one problem when using this on macOS: The menu remains opened when clicking into the GUI of the hosted plugin.
As the menu is always in front of the plugin GUI, it is required that it is closed when I want to interact with the plugin. But it is necessary to click onto the MenuBarComponent or somewhere outside the plugin Window (or select anything from the menu) to close the menu again.

On Windows, this behaves as expected.

I did some debugging and found that on Windows, PluginWindow::dismissMenu() is always called when clicking anywhere into the plugin GUI. On macOS, this just does not happen.

Does anybody have an idea, how this could be fixed?

I think the menu window and the main window are ‘orphaned’ from each other on MacOS - i.e. the menu should be associated with the main window as a child<-parent relationship, but this is decoupled for some reason. Maybe take a look at whether you can re-build this association, so that events propagate from parent->child (main window → menu) down the stack.