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.
- Use native menu bar by MenuBarModel::setMacMainMenu(), and some menu items have shortcut keys.
- Open popup menu of the menu bar by mouse click.
- While showing the popup menu, press down any shortcut key (like command+s) and invoke menu item action.
- Show modal dialog using FileChooser or AlertWindow in the action.
- 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?
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?
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)
- Launch the introjucer.
- Click “File” menu on menu bar located on top of the screen. (File popup menu will be shown)
- Then press down command+O key. Don’t use mouse here. (“Open File” dialog will be shown)
- Click “Cancel” button and close the dialog.
- 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)
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!