Flickering in the native menu

This happens (at least) in OS X 10.11.4

To reproduce:

  • Launch the Demo.
  • Tabs & Widgets -> Menus -> Look-and-feel -> Use Native Menu Bar
  • Observe the native menu bar and press e.g. Command - I

-> The menu item ‘Look-and-feel’ flickers (2 times) instead of just flashing up once.

I don’t understand the code involved, but one flicker is triggered at

static void JuceMenuCallbackClass::menuItemInvoked (id self, SEL, NSMenuItem* item)

which calls

bool NSViewComponentPeer::handleKeyEvent (NSEvent* ev, bool isKeyDown)

used = handleKeyUpOrDown (true) || used;
used = handleKeyPress (keyCode, textCharacter) || used;


Outcomment the second line and the menu item will only flash up once (but it will not work anymore). Maybe this helps in tracking the issue down.


@Jules, do you have any idea where the second flicker is triggered?

This is one of those posts where I can see it’ll take a lot of debugging, and am a bit busy right now. It’s in my bookmarks, but can’t promise when I’ll get chance to look at it.

Thanks for the reply, good to know that you noticed.

No urgency on my side about this.

Thank you @jules for addressing this in your recent commit a46191ad!