iOS PopupMenus not returning

Hi All,

Having an issue where once I’ve called BluetoothMidiDevicePairingDialogue::open(), popup menus in my app stop returning a value on close. Pairing dialogue is working beautifully, the PopupMenus are working visually, just not returning anything…

This happens both for menus shown async and menus shown modally, i’m a bit stumped. Has anyone got any ideas?

That’s pretty bizarre! Can you debug to catch the menus being clicked on and see where it goes?

I can have a go! What’s the best way of catching MouseEvents at the top level?

Oh, maybe stick some breakpoints inside the PopupMenu code, in the mouseDown callback, perhaps, and dig around in there.

Of course, sorry.

It looks like the isCurrentlyBlockedByAnotherModalComponent() function in Component::internalMouseDown is returning true when it shouldn’t be, meaning the mouse event is not routed to the PopupMenu MouseSourceState object as normal.

Maybe just a flag not being reset?

Yes, sounds likely. We’ll have a look…

Great, thanks!

Thanks for reporting @lukealpha. Turns out it had nothing to do with the bluetooth selector specifically, but with any component peer being dismissed by a mouse down event. The corresponding mouse-up event would get lost and JUCE would think that there is always still a mouse button down somewhere.

A fix for this will appear on develop shortly with commit 2021c64.

1 Like

Brilliant, cheers guys.