Hi,
the commit 5fc8d3485d4b41d63beafa30d7f5ba9456e13658 (“ModalComponentManager (macOS): Raise modal windows to the modal window level”) caused a regression for long popup menus with sub-menus. On macOS, the submenu will be displayed below the parent menu. It is obvious when the top menu is long enough to be displayed in more than one column, in which case submenus are hidden below their parent.
It can be reproduced in the DemoRunner by changing the longMenuButton demo:
addAndMakeVisible (longMenuButton);
longMenuButton.onClick = [&]
{
PopupMenu menu;
for (int i = 0; i < 80; ++i) {
if ((i % 10) == 0)
{
PopupMenu submenu;
for (int j=0; j < 20; ++j)
{
submenu.addItem("xxxxxxx SubItem " + String(j), nullptr);
}
menu.addSubMenu("SubMenu " + String(i), submenu);
}
else
{
menu.addItem ("Item " + String (i), nullptr);
}
}
menu.showMenuAsync (PopupMenu::Options{}.withTargetComponent (longMenuButton));
};
A simple fix is to exclude temporary windows from the patch , for example
if (isSharedWindow)
return {};
+ // fix for regression of juce 9.0.2 commit "Raise modal windows to the modal window level"
+ // submenus of PopupMenu windows appear below the parent PopupMenu
+ if ((getStyleFlags() & ComponentPeer::windowIsTemporary) != 0)
+ return {};
auto* manager = ModalComponentManager::getInstance();
(btw I would suggest that you add such a test-case to DemoRunner as the combinaison of long menu + sub menus (and maybe more than one level of submenu) is the most tricky)