File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,22 +32,24 @@ mainWindow.webContents.sendInputEvent({
3232 keyCode : '\u0008'
3333} )
3434
35- mainWindow . on ( 'close' , function ( e ) {
36- if ( process . platform === 'linux' && process . env . DESKTOP_SESSION !== 'cinnamon' ) {
35+ if ( process . platform !== 'linux' || process . env . DESKTOP_SESSION === 'cinnamon' ) {
36+ mainWindow . on ( 'close' , function ( e ) {
37+ mainWindow . hide ( )
38+ e . preventDefault ( )
39+ } )
40+
41+ app . on ( 'before-quit' , function ( e ) {
42+ mainWindow . removeAllListeners ( )
43+ } )
44+ } else {
45+ app . on ( 'window-all-closed' , function ( ) {
3746 app . quit ( )
38- return true
39- }
40- mainWindow . hide ( )
41- e . preventDefault ( )
42- } )
47+ } )
48+ }
4349
4450app . on ( 'activate' , function ( ) {
4551 if ( mainWindow == null ) return null
4652 mainWindow . show ( )
4753} )
4854
49- app . on ( 'before-quit' , function ( e ) {
50- mainWindow . removeAllListeners ( )
51- } )
52-
5355module . exports = mainWindow
You can’t perform that action at this time.
0 commit comments