Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Mojave: fix hang on launch #404

Closed
wants to merge 2 commits into from

Conversation

troughton
Copy link
Contributor

On Mojave, [NSApp menuBar] doesn't exist until after applicationDidFinishLaunching, causing nsMenuBar to be nil (and Clear() to never exit since numberOfItems is 0). Rather than restructuring the lifecycle of the app, just create our own menu bar and set it as the main menu.

whitequark and others added 2 commits May 13, 2019 09:03
On Mojave, [NSApp menuBar] doesn't exist until after applicationDidFinishLaunching, causing `nsMenuBar` to be nil (and `Clear()` to never exit since `numberOfItems` is 0). Rather than restructuring the lifecycle of the app, just create our own menu bar and set it as the main menu.
@CLAassistant
Copy link

CLAassistant commented May 13, 2019

CLA assistant check
All committers have signed the CLA.

@whitequark
Copy link
Contributor

The reason it was using the existing main menu is that it's the one created from this nib which IIRC was required for the default items in the system menu to work properly. E.g. that's where the Preferences… item lives. Does that still work?

@troughton
Copy link
Contributor Author

troughton commented May 13, 2019

Okay, it does still work using the .nib if the Xcode project is set up properly or if the make-based build system is used instead – it's only the generated Xcode project that has issues. I'm going to close this, but the while([nsMenuBar numberOfItems] > 1) change might be worthwhile on its own in case others run into the same issue.

@troughton troughton closed this May 13, 2019
@troughton troughton deleted the patch-1 branch May 13, 2019 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants