diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/main.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/main.js b/app/main.js index 0c5eb7ec73..df7f9fbf50 100644 --- a/app/main.js +++ b/app/main.js @@ -41,7 +41,11 @@ const appDelegate = { log.info('Running version', version); - appDelegate._startBackend(); + // Only macOS builds still launch the daemon manually. + // On other platforms mullvad-daemon already runs as a system service. + if (process.platform === 'darwin') { + appDelegate._startBackend(); + } app.on('window-all-closed', () => appDelegate.onAllWindowsClosed()); app.on('ready', () => appDelegate.onReady()); @@ -95,15 +99,18 @@ const appDelegate = { ipcMain.on('hide-window', () => window.hide()); window.loadURL('file://' + path.join(__dirname, 'index.html')); - if (process.platform === 'linux') { + + // Since macOS still runs the daemon manually it has to shut it down. + // On other platforms closing the app only disconnects the tunnel. + if (process.platform === 'darwin') { window.on('close', () => { - log.debug('The browser window is closing, shutting down the tunnel...'); - window.webContents.send('disconnect'); + log.debug('The browser window is closing, shutting down the daemon...'); + window.webContents.send('shutdown'); }); } else { window.on('close', () => { - log.debug('The browser window is closing, shutting down the daemon...'); - window.webContents.send('shutdown'); + log.debug('The browser window is closing, shutting down the tunnel...'); + window.webContents.send('disconnect'); }); } |
