# Issue when adding a menu to PluginWindow in AudioPluginHost

**URL:** <https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031>\
**Category:** Audio Plugins\
**Created:** [June 23, 2026, 2:57pm UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031 "2026-06-23T14:57:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gphofa](https://avatars.discourse-cdn.com/v4/letter/g/3ec8ea/32.png) [@gphofa](https://forum.juce.com/u/gphofa)\
**Post date:** [June 23, 2026, 2:57pm UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031/1 "2026-06-23T14:57:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ibisum](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ibisum/32/21288_2.png) [@ibisum](https://forum.juce.com/u/ibisum)\
**Post date:** [June 24, 2026, 1:52pm UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031/2 "2026-06-24T13:52:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mgrand](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mgrand/32/14447_2.png) [@mgrand](https://forum.juce.com/u/mgrand)\
**Post date:** [September 15, 2026, 11:52am UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031/3 "2026-09-15T11:52:29Z")

</div>

I encountered this as well. It seems to affect any `windowIsTemporary` window, on macOS only (Windows behaves correctly).

From what I found, plug-in editors are wrapped in their own native `NSViewComponent` component on Mac. Mouse events handled by that view don’t reach JUCE’s modal-component handling, so the temporary window never receives `inputAttemptWhenModal()`.

It would be great if the JUCE team could fix this in the macOS event routing, this is really annoying when hosting plug-ins on Mac. In the meantime I worked around it with an `NSEvent` monitor, calling `PopupMenu::dismissAllActiveMenus()` on each mouse-down outside a JUCE temporary window.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [September 18, 2026, 12:21pm UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031/4 "2026-09-18T12:21:06Z")

</div>

Thanks for reporting, a fix for this issue has been added to the develop branch:

> <https://github.com/juce-framework/JUCE/commit/44632f19ec7ffd2a63e8c5ed06242e9e3fd642cb>
>
> This was particularly obvious when adding menu bar components to windows
> contain…ing plugin editors. The menus would remain open when attempting
> to interact with the plugin view.

---

<div class="post-metadata">

**Author:** ![mgrand](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mgrand/32/14447_2.png) [@mgrand](https://forum.juce.com/u/mgrand)\
**Post date:** [September 21, 2026, 3:42pm UTC](https://forum.juce.com/t/issue-when-adding-a-menu-to-pluginwindow-in-audiopluginhost/69031/5 "2026-09-21T15:42:39Z")

</div>

The fix works thanks!

Might be worth mentioning that clicking a native title bar doesn’t reliably dismiss a temporary window either. (Edge case but still annoying in some situations)
