File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -313,15 +313,6 @@ function createWindowWithBounds (bounds) {
313313 return newWin
314314}
315315
316- // Quit when all windows are closed.
317- app . on ( 'window-all-closed' , function ( ) {
318- // On OS X it is common for applications and their menu bar
319- // to stay active until the user quits explicitly with Cmd + Q
320- if ( process . platform !== 'darwin' ) {
321- app . quit ( )
322- }
323- } )
324-
325316// This method will be called when Electron has finished
326317// initialization and is ready to create browser windows.
327318app . on ( 'ready' , function ( ) {
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ const windows = {
2222
2323 window . on ( 'closed' , function ( ) {
2424 windows . removeWindow ( window )
25+
26+ // Quit on last window closed (ignoring secondary and hidden windows)
27+ if ( windows . openWindows . length === 0 && process . platform !== 'darwin' ) {
28+ app . quit ( )
29+ }
2530 } )
2631
2732 windows . nextId ++
You can’t perform that action at this time.
0 commit comments