Skip to content

Commit f421e83

Browse files
committed
Quit app on window close on macOS
1 parent b4be062 commit f421e83

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

main.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,13 @@ const createWindow = () => {
115115
// Some APIs can only be used after this event occurs.
116116
app.on('ready', createWindow);
117117

118-
// Quit when all windows are closed, except on macOS. There, it's common
119-
// for applications and their menu bar to stay active until the user quits
120-
// explicitly with Cmd + Q.
118+
// Quit when all windows are closed, including on macOS
121119
app.on('window-all-closed', () => {
122120
const upnp = getUpnpApi();
123121
upnp.ssdpStop(); //TODO only stop what we actually started...
124122
upnp.stop().catch(() => null).finally(() => {
125123
stopPowerSaver();
126-
if (process.platform !== 'darwin') {
127-
app.quit();
128-
}
124+
app.quit();
129125
})
130126
});
131127

132-
app.on('activate', () => {
133-
// On OS X it's common to re-create a window in the app when the
134-
// dock icon is clicked and there are no other windows open.
135-
if (BrowserWindow.getAllWindows().length === 0) {
136-
createWindow();
137-
}
138-
});

0 commit comments

Comments
 (0)