File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ if (isWindows) {
2626}
2727
2828// Force single window
29- // if (process.platform !== 'darwin') {
3029const isSecondInstance = app . makeSingleInstance ( ( ) => {
3130 console . log ( mainWindow ) ;
3231 console . log ( 'isMinimized' , mainWindow . isMinimized ) ;
@@ -40,7 +39,6 @@ if (isSecondInstance) {
4039 app . exit ( ) ;
4140}
4241
43- // }
4442
4543// Initialize Settings
4644const settings = new Settings ( ) ;
@@ -89,9 +87,13 @@ const createWindow = async () => {
8987 // when you should delete the corresponding element.
9088 if ( ! willQuitApp && ( settings . get ( 'runInBackground' ) === undefined || settings . get ( 'runInBackground' ) ) ) {
9189 e . preventDefault ( ) ;
92- mainWindow . hide ( ) ;
90+ if ( isWindows ) {
91+ mainWindow . minimize ( ) ;
92+ } else {
93+ mainWindow . hide ( ) ;
94+ }
9395
94- if ( process . platform === 'win32' ) {
96+ if ( isWindows && settings . get ( 'minimizeToSystemTray' ) ) {
9597 mainWindow . setSkipTaskbar ( true ) ;
9698 }
9799 } else {
@@ -114,13 +116,6 @@ const createWindow = async () => {
114116 app . isMaximized = true ;
115117 } ) ;
116118
117- mainWindow . on ( 'close' , ( e ) => {
118- if ( settings . get ( 'minimizeToSystemTray' ) && settings . get ( 'runInBackground' ) ) {
119- e . preventDefault ( ) ;
120- mainWindow . minimize ( ) ;
121- }
122- } ) ;
123-
124119 mainWindow . on ( 'unmaximize' , ( ) => {
125120 app . isMaximized = false ;
126121 } ) ;
You can’t perform that action at this time.
0 commit comments