Ok, just FYI if someone has the same issue, I managed to get it to work.
I guess the idea is if you are using the system tray with a native macOS menu, you should also configure the native macOS menu on the top left of the screen, fair enough.
But if like me you are not using the menus at all, only the system tray one, then you can simply instanciate a dummy MenuBarModel in your application and call MenuBarModel::setMacMainMenu() with it.
Something like this:
#if JUCE_MAC
class dummyMenuBarModel final : public juce::MenuBarModel
{
public:
dummyMenuBarModel() {
juce::MenuBarModel::setMacMainMenu(this);
}
~dummyMenuBarModel() override {
juce::MenuBarModel::setMacMainMenu (nullptr);
}
juce::StringArray getMenuBarNames() override { return {""}; }
juce::PopupMenu getMenuForIndex (int, const juce::String&) override { return juce::PopupMenu(); }
void menuItemSelected (int, int) override {}
};
#endif
// ...
class myApplication final : public juce::JUCEApplication
{
public:
// ...
private:
#if JUCE_MAC
dummyMenuBarModel model;
#endif
};
Simon
