Skip to content

fix: set default menu in will-finish-launching event#23214

Merged
codebytere merged 1 commit into
masterfrom
before-ready
Apr 23, 2020
Merged

fix: set default menu in will-finish-launching event#23214
codebytere merged 1 commit into
masterfrom
before-ready

Conversation

@zcbenz
Copy link
Copy Markdown
Contributor

@zcbenz zcbenz commented Apr 22, 2020

Description of Change

Close #23026, which was regressed due to setDefaultApplicationMenu being changed to use whenReady. When user uses ready event directly, their callback would be called before setDefaultApplicationMenu() and the default menu would override their menu settings.

It is hard to ensure the setDefaultApplicationMenu is called before user's ready callbacks, especially when promises are involved. However we can use the will-finish-launching event which is guaranteed to be called before the ready event, and we have explicitly documented that users should only create window after the ready event.

Checklist

Release Notes

Notes: Fix win.setMenuBarVisibility(false) not hiding menu bar.

@zcbenz zcbenz requested review from ckerr and deepak1556 April 22, 2020 06:39
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 22, 2020
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 23, 2020
@codebytere codebytere merged commit cb6a1e2 into master Apr 23, 2020
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Apr 23, 2020

Release Notes Persisted

Fix win.setMenuBarVisibility(false) not hiding menu bar.

@codebytere codebytere deleted the before-ready branch April 23, 2020 17:51
@trop
Copy link
Copy Markdown
Contributor

trop Bot commented Apr 23, 2020

I have automatically backported this PR to "9-x-y", please check out #23263

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.

Menu bar is shown while setMenuBarVisibility(false)

3 participants