Hi,
Noticed something fishy with macOS native MenuBar.
Steps to reproduce: launch DemoRunner/GUI/MenusDemo.h
, hit a menu keyboard shortcut (command-R for instance); the JUCE MenuBar flashes, indicating the menu it triggered. Now hit Menu Position → Global menu (i.e., native menubar), hit the same keyboard shortcut, the menu bar doesn’t flash.
I’ve tracked down the problem to this inexplicable conditional in juce_mac_MainMenu.mm
:
void menuCommandInvoked (MenuBarModel*, const ApplicationCommandTarget::InvocationInfo& info) override
{
if ((info.commandFlags & ApplicationCommandInfo::dontTriggerVisualFeedback) == 0
&& info.invocationMethod != ApplicationCommandTarget::InvocationInfo::fromKeyPress)
if (auto* item = findMenuItemWithCommandID (getMainMenuBar(), info.commandID))
flashMenuBar ([item menu]);
}
If I remove the condition info.invocationMethod != ApplicationCommandTarget::InvocationInfo::fromKeyPress
, it flashes again and doesn’t seem to have any detrimental side-effects. Why would you prevent flashing the menu on keypresses? It seems like the whole point of flashing…