Hi Jules,
When enabling the native menu in the jucedemo on macos 10.4, the menubar entries “Demo” and “Look-and-Feel” are duplicated at first, and the jucedemo app crashes very quickly. JuceDemo 1.52 works, and JuceDemo 1.53 does crash.
This change occured between juce 1.52 and 1.53:
version 1.52:
[code] void updateSubMenu (NSMenuItem* parentItem, const PopupMenu& menuToCopy,
const String& name, const int menuId, const int tag)
{
[parentItem setTag: tag];
NSMenu* menu = [parentItem submenu];
[menu setTitle: juceStringToNS (name)];
while ([menu numberOfItems] > 0)
[menu removeItemAtIndex: 0];
PopupMenu::MenuItemIterator iter (menuToCopy);
while (iter.next())
addMenuItem (iter, menu, menuId, tag);
[menu setAutoenablesItems: false];
[menu update];
}
[/code]
version 1.53
[code] void updateSubMenu (NSMenuItem* parentItem, const PopupMenu& menuToCopy,
const String& name, const int menuId, const int tag)
{
// Note: This method used to update the contents of the existing menu in-place, but that caused
// weird side-effects which messed-up keyboard focus when switching between windows. By creating
// a new menu and replacing the old one with it, that problem seems to be avoided…
NSMenu* menu = [[NSMenu alloc] initWithTitle: juceStringToNS (name)];
PopupMenu::MenuItemIterator iter (menuToCopy);
while (iter.next())
addMenuItem (iter, menu, menuId, tag);
[menu setAutoenablesItems: false];
[menu update];
[parentItem setTag: tag];
[parentItem setSubmenu: menu];
[menu release];
}
[/code]
Reverting this change does seem to fix the macos 10.4 issue, but the comment that you had put there seem to indicate that there was a reason for this change…
