Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13242 from brave/fix/quit-on-close-buffer-window
Browse files Browse the repository at this point in the history
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()) {

This comment has been minimized.

Copy link
@armaanahluwalia

armaanahluwalia Mar 23, 2018

@bsclifton I have a question regarding why the isDarwin check is being performed here. I believe this is what is causing #8164

This comment has been minimized.

Copy link
@bsclifton

bsclifton Mar 26, 2018

Author Member

@armaanahluwalia this check only happens when all windows are closed. macOS keeps Brave open when no windows are left, unlike Windows / Linux. The buffer window optimization is not released yet (it's part of 0.22.x); this has been an issue for quite some time (reported with 0.14.1)

It's good you tracked this down though- this code may interfere with any potential fixes for #8164

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.