8000 fix: set default menu in will-finish-launching event by zcbenz · Pull Request #23214 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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

Merged
merged 1 commit into from
Apr 23, 2020
Merged

Conversation

zcbenz
Copy link
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
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
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
0