fix: simplify window / app close behavior

Closes #142
This commit is contained in:
talksik
2026-04-12 10:22:21 -07:00
parent 484ee9d4fb
commit bfa970d706
+6 -9
View File
@@ -51,6 +51,7 @@ const createWindow = () => {
mainWindow.on('closed', () => {
mainWindow = null;
app.quit();
});
};
@@ -419,20 +420,16 @@ app.on('ready', () => {
createAutoplayWindow();
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
app.quit();
});
app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
if (!mainWindow) {
createWindow();
} else {
mainWindow.show();
mainWindow.focus();
}
});