Skip to content

Commit

Permalink
Merge pull request brave#13242 from brave/fix/quit-on-close-buffer-wi…
Browse files Browse the repository at this point in the history
…ndow

When closing last window, make sure buffer window is closed so that app exits
  • Loading branch information
bsclifton authored Feb 22, 2018
2 parents 1fd05ca + 97baf96 commit 12aa8bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/browser/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ const api = {
win.once('closed', () => {
appActions.windowClosed(windowId)
cleanupWindow(windowId)
// if we have a bufferWindow, the 'window-all-closed'
// event will not fire once the last window is closed,
// so close the buffer window if this is the last closed window
// apart from the buffer window
if (!platformUtil.isDarwin() && api.getBufferWindow()) {
const remainingWindows = api.getAllRendererWindows().filter(win => win !== api.getBufferWindow())
if (!remainingWindows.length) {
api.closeBufferWindow()
}
}
})
win.on('blur', () => {
appActions.windowBlurred(windowId)
Expand Down

0 comments on commit 12aa8bb

Please sign in to comment.