File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -454,15 +454,6 @@ module.exports = class AtomApplication extends EventEmitter {
454454 // Public: Removes the {AtomWindow} from the global window list.
455455 removeWindow ( window ) {
456456 this . windowStack . removeWindow ( window ) ;
457- if ( this . getAllWindows ( ) . length === 0 ) {
458- if ( this . applicationMenu != null ) {
459- this . applicationMenu . enableWindowSpecificItems ( false ) ;
460- }
461- if ( [ 'win32' , 'linux' ] . includes ( process . platform ) ) {
462- app . quit ( ) ;
463- return ;
464- }
465- }
466457 if ( ! window . isSpec ) this . saveCurrentWindowOptions ( true ) ;
467458 }
468459
@@ -773,6 +764,18 @@ module.exports = class AtomApplication extends EventEmitter {
773764 } )
774765 ) ;
775766
767+ this . disposable . add (
768+ ipcHelpers . on ( app , 'window-all-closed' , ( ) => {
769+ if ( this . applicationMenu != null ) {
770+ this . applicationMenu . enableWindowSpecificItems ( false ) ;
771+ }
772+ if ( [ 'win32' , 'linux' ] . includes ( process . platform ) ) {
773+ app . quit ( ) ;
774+ return ;
775+ }
776+ } )
777+ ) ;
778+
776779 // Triggered by the 'open-file' event from Electron:
777780 // https://electronjs.org/docs/api/app#event-open-file-macos
778781 // For example, this is fired when a file is dragged and dropped onto the Atom application icon in the dock.
You can’t perform that action at this time.
0 commit comments