fix: set default menu in will-finish-launching event (#23214)
This commit is contained in:
parent
69ccf94d45
commit
cb6a1e2c5e
2 changed files with 7 additions and 5 deletions
|
@ -207,10 +207,9 @@ const { setDefaultApplicationMenu } = require('@electron/internal/browser/defaul
|
|||
|
||||
// Create default menu.
|
||||
//
|
||||
// Note that the task must be added before loading any app, so we can make sure
|
||||
// the call is maded before any user window is created, otherwise the default
|
||||
// menu may show even when user explicitly hides the menu.
|
||||
app.whenReady().then(setDefaultApplicationMenu);
|
||||
// The |will-finish-launching| event is emitted before |ready| event, so default
|
||||
// menu is set before any user window is created.
|
||||
app.once('will-finish-launching', setDefaultApplicationMenu);
|
||||
|
||||
if (packagePath) {
|
||||
// Finally load app's main.js and transfer control to C++.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue