Dismiss PopupMenu when focus changes

This is with the Windows AudioPluginHost, latest commit ec43c7f .

Windows 10 20H2. VST3.

Video:

Test project:

FocusTest2.zip (23.0 KB)

Thanks, I have a fix for this issue awaiting review, it should be on develop in the next day or so.

4 Likes

Thanks @reuk! I’m on 5.4.7, will I need to upgrade to JUCE 6 to pull from the branch?

Yes, the popup menu fixes are part of JUCE 6.

This bug should be resolved by the following patch:

Please let us know if you encounter any new issues as a result of this change.

1 Like

The popup menu fixes are great.

One thing makes juce::PopupMenu behave different than other popups is clicking outside it actually dispatched what you click on. (instead of dismissing)

On macOS for example if you click on something while in a menu/popup, it would simply dismiss the popup.

With JUCE when we click on anything outside the popup it’ll trigger the mouseDown.
Might be useful sometimes but I’m pretty sure the other way is more common.

3 Likes

If you have the PopupMenu open and don’t make a selection and close it… it doesn’t reset the AlwaysOnTop flag – so if you’re in Logic for instance and open a PopupMenu in the plugin and drag another plugin over your Editor… it’s put behind your plugin (z-order is off).

Rail

Thanks for reporting this issue. I’ve pushed a fix here:

Please try it out and let us know if you encounter any new issues.

Even with the fix of Oct 19, 2021, mouse clicking outside the menu (dismisses the menu) but also returns the menu item id (I only have one menu item, if that makes any difference).
Is there anyway to stop this or catch the menu closing?

Ah, Ok - the event gets called with the choice = ID of the menu if it loses focus but the id of the choice if a menu is selected. It’s quite important to make sure that these don’t overlap!