Menu disabled in MacOsX and CLion

Hello,

I have a very very strange problem with menus, only on MacOsX, only if the “mac menu bar” is used, and only with CLion! To show the problem, I built a almost empty project, which can be found here.

There is only one menu with one item. Using Xcode everything is fine. Compiling with CLion, the app runs but the menu is disabled! Is there something wrong in the way I am declaring my menus? Or is it a strange bug in Juce? The “bug” disappear when the menu is declared as a normal menu (there is a commented section to do that quickly in the code).

Thanks!
Julien.

One more information: for whatever reason, CLion launches the app “in background”, so is not focused. Maybe that’s the problem why the menu is disabled? However, if I click on the app in the tray to put in on foreground, the menus are still disabled.

What about launching the app from the Finder?

Indeed, from the Finder, it works fine. However, this “bug” prevents me from using CLion. Maybe the problem is how I declare the menus?

I’m really not sure what’s going on, but If it’s working when you run the app from Finder then this is likely to be an issue with how CLion is launching your executable.

Ah! Now I’ve found a way to reproduce the bug I was looking for, and it is not CLion related. I have updated the project. I believe it may be a JUCE bug: after showing a Modal Dialog, which spawns a File Chooser, the MacOs menu becomes disabled after the Modal Dialog and File Chooser are closed:

Please run the project on MacOsX:

  • The “First” menu has two options: “Test” and “Quit”. Select “Test”.
  • A pop-up opens. Click on the “Hello” Button.
  • A File Chooser opens. Click either on “cancel” or “save” after entering a file name.
  • Close the Modal Dialog with the “X”.
  • Opens the MacOs menu: the “File”/“Test” choice is now disabled!

I really wonder why, and my “real” app is suffering from this problem which I can not explain. Thanks for your help!

Allow me to “bump” the thread as, as the updated project shows, there is something really strange going on with the modal dialog + File Chooser + MacOs menu. Thanks!