Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(app): quit when window closed on non-darwin
Browse files Browse the repository at this point in the history
On darwin, we keep the app running and just hide it when the window is
closed as that is the standard convention. On linux and windows the app
should be quit when the window is closed.

This resolves an issue where on linux/windows the app would remain open
when the window is closed, with no way to properly quit it short of
doing a force quit.
  • Loading branch information
mrfelton committed Aug 14, 2018
1 parent d45d171 commit ddbdf01
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/lib/zap/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ class ZapController {

// When the window is closed, just hide it unless we are force closing.
this.mainWindow.on('close', e => {
if (this.mainWindow.forceClose) {
return
if (process.platform === 'darwin' && !this.mainWindow.forceClose) {
e.preventDefault()
this.mainWindow.hide()
}
e.preventDefault()
this.mainWindow.hide()
})
}

Expand Down

0 comments on commit ddbdf01

Please sign in to comment.