feat: use default-app behavior in packaged apps (#16310)
Unify the behavior between default app and packaged apps: - create default application menu unless the app has one - default window-all-closed handling unless the app handles the event
This commit is contained in:
parent
8e2ab8b20b
commit
23d44e322d
11 changed files with 133 additions and 37 deletions
20
spec/fixtures/api/window-all-closed/main.js
vendored
Normal file
20
spec/fixtures/api/window-all-closed/main.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
|
||||
let handled = false
|
||||
|
||||
if (app.commandLine.hasSwitch('handle-event')) {
|
||||
app.on('window-all-closed', () => {
|
||||
handled = true
|
||||
app.quit()
|
||||
})
|
||||
}
|
||||
|
||||
app.on('quit', () => {
|
||||
process.stdout.write(JSON.stringify(handled))
|
||||
process.stdout.end()
|
||||
})
|
||||
|
||||
app.on('ready', () => {
|
||||
const win = new BrowserWindow()
|
||||
win.close()
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue