diff --git a/src/components/shared/setDefaultSettings.ts b/src/components/shared/setDefaultSettings.ts index d49c355..7342656 100644 --- a/src/components/shared/setDefaultSettings.ts +++ b/src/components/shared/setDefaultSettings.ts @@ -77,7 +77,11 @@ const setDefaultSettings = (force: boolean) => { } if (force || !settings.hasSync('exitToTray')) { - settings.setSync('exitToTray', false); + let defaultExitToTray = false; + if (isMacOS()) { + defaultExitToTray = true; + } + settings.setSync('exitToTray', defaultExitToTray); } if (force || !settings.hasSync('showDebugWindow')) { diff --git a/src/main.dev.js b/src/main.dev.js index 6674dec..f0894b5 100644 --- a/src/main.dev.js +++ b/src/main.dev.js @@ -49,6 +49,7 @@ replayActionMain(store); let mainWindow = null; let tray = null; let exitFromTray = false; +let forceQuit = false; if (process.env.NODE_ENV === 'production') { const sourceMapSupport = require('source-map-support'); @@ -538,6 +539,9 @@ const createWindow = async () => { event.preventDefault(); mainWindow.hide(); } + if (forceQuit) { + app.exit(); + } }); if (isWindows()) { @@ -586,6 +590,10 @@ const createWindow = async () => { height: window.height, }); }); + + app.on('before-quit', () => { + forceQuit = true; + }); } mainWindow.once('maximize', () => { diff --git a/src/menu.ts b/src/menu.ts index ffad513..4383dc6 100644 --- a/src/menu.ts +++ b/src/menu.ts @@ -68,7 +68,7 @@ export default class MenuBuilder { label: 'Quit', accelerator: 'Command+Q', click: () => { - app.quit(); + app.exit(); }, }, ],