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) {
26
26
}
27
27
28
28
// Force single window
29
- // if (process.platform !== 'darwin') {
30
29
const isSecondInstance = app . makeSingleInstance ( ( ) => {
31
30
console . log ( mainWindow ) ;
32
31
console . log ( 'isMinimized' , mainWindow . isMinimized ) ;
@@ -40,7 +39,6 @@ if (isSecondInstance) {
40
39
app . exit ( ) ;
41
40
}
42
41
43
- // }
44
42
45
43
// Initialize Settings
46
44
const settings = new Settings ( ) ;
@@ -89,9 +87,13 @@ const createWindow = async () => {
89
87
// when you should delete the corresponding element.
90
88
if ( ! willQuitApp && ( settings . get ( 'runInBackground' ) === undefined || settings . get ( 'runInBackground' ) ) ) {
91
89
e . preventDefault ( ) ;
92
- mainWindow . hide ( ) ;
90
+ if ( isWindows ) {
91
+ mainWindow . minimize ( ) ;
92
+ } else {
93
+ mainWindow . hide ( ) ;
94
+ }
93
95
94
- if ( process . platform === 'win32' ) {
96
+ if ( isWindows && settings . get ( 'minimizeToSystemTray' ) ) {
95
97
mainWindow . setSkipTaskbar ( true ) ;
96
98
}
97
99
} else {
@@ -114,13 +116,6 @@ const createWindow = async () => {
114
116
app . isMaximized = true ;
115
117
} ) ;
116
118
117
- mainWindow . on ( 'close' , ( e ) => {
118
- if ( settings . get ( 'minimizeToSystemTray' ) && settings . get ( 'runInBackground' ) ) {
119
- e . preventDefault ( ) ;
120
- mainWindow . minimize ( ) ;
121
- }
122
- } ) ;
123
-
124
119
mainWindow . on ( 'unmaximize' , ( ) => {
125
120
app . isMaximized = false ;
126
121
} ) ;
You can’t perform that action at this time.
0 commit comments