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

When closing last window, make sure buffer window is closed so that app exits #13242

Merged
merged 1 commit into from
Feb 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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