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

Commit

Permalink
When closing last window, make sure buffer window is closed so that a…
Browse files Browse the repository at this point in the history
…pp exits.

Only on win/linux, since we only handle 'window-all-closed' on those platforms.
Fix #13233
  • Loading branch information
petemill authored and bsclifton committed Feb 22, 2018
1 parent 1fd05ca commit 97baf96
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 97baf96

Please sign in to comment.