Native menu bar issue?

Hi all,

Now I’m making a Mac stand-alone app using juce 2.0.38.
Then I found a menu bar issue on mac as below.

  1. Use native menu bar by MenuBarModel::setMacMainMenu(), and some menu items have shortcut keys.
  2. Open popup menu of the menu bar by mouse click.
  3. While showing the popup menu, press down any shortcut key (like command+s) and invoke menu item action.
  4. Show modal dialog using FileChooser or AlertWindow in the action.
  5. After closing the modal dialog, application will crash.

I’m checking source code around MainMenu, but now I cannot find good countermeasure…
Can somebody help about this?

Best regards,
Tomoyuki Kato
Korg Inc.

Hmm, I tried this in the introjucer, by right-clicking on some source code to get a popup menu, then hitting cmd-O, but it correctly ignored the shortcut.

Where exactly did it crash?

Hi jules,

This crash is occurred by menu bar that is located on top of the screen. It is not on right-click popup menu.

I also tried this in the introjucer, and it occurred.
Detailed procedure is as below:

I used zip version of juce, and built it on Xcode 4.2 ( OS X 10.6.8 )
(downloaded from https://github.com/julianstorer/JUCE/archive/master.zip)

  1. Launch the introjucer.
  2. Click “File” menu on menu bar located on top of the screen. (File popup menu will be shown)
  3. Then press down command+O key. Don’t use mouse here. (“Open File” dialog will be shown)
  4. Click “Cancel” button and close the dialog.
  5. Then the introjucer often crash. (Sometimes it did not happened)

Then, got following log.
Debugger stopped at L510 of “juce_mac_MainMenu.mm” when I tried debug version. (peer->redirectKeyDown (e):wink:
Does this help you?

Ok, thanks - I’ve sorted that out now, let me know if you still have problems!

I updated to the new source code, and checked fixing this.
Thank you for the quick response and fixing!