JUCE PopupMenus can get locked into an unresponsive mode where the UI starts flickering. This happens on iOS and Android, and is related to multi-touch operation.
The issue is easy to reproduce with the JUCE DemoRunner app (for example on Android):
- Click ‘Browse demos’
- Select ‘GUI’
- Select ‘WidgetsDemo.h’
- From the menu bar, select ‘Menus’
- Hold one finger somewhere on the screen where there are no buttons
- while holding that finger, use a second finger to select ‘Nested Sub-Menus’ and then select one of the sub menus that appear
- Release the screen with both fingers. The flickering menu options start to appear.
There is at least one solution to solve this, which is to not call ‘highlightItemUnderMouse()’ in juce_PopupMenu.cpp, line 1341, but instead make it dependent on mouse events actually happening in the window:
if (window.reallyContains(localMousePos, true)) // EDIT - new requirement
highlightItemUnderMouse (globalMousePos, localMousePos, timeNow);
Hope this helps! This is a relevant use case for synths with an on-screen keyboard, in which one could be playing the keys while selecting something from a PopupMenu to change the sound. This is currently problematic as it triggers this bug.