@@ -13,6 +13,8 @@ const buildMenu = require('./eme/menu')
13
13
const emeWindow = require ( './eme/window' )
14
14
const config = require ( './eme/config' )
15
15
16
+ const platform = os . platform ( )
17
+
16
18
const appMenu = buildMenu ( {
17
19
createWindow : emeWindow . createWindow
18
20
} )
@@ -22,7 +24,7 @@ const createMainWindow = () => {
22
24
defaultWidth : 800 ,
23
25
defaultHeight : 600
24
26
} )
25
- if ( process . platform === 'linux' ) {
27
+ if ( platform === 'linux' ) {
26
28
windowState . icon = path . join ( __dirname , 'resources/icon.png' )
27
29
}
28
30
const win = emeWindow . createWindow ( { windowState} )
@@ -35,20 +37,23 @@ app.on('ready', () => {
35
37
Menu . setApplicationMenu ( appMenu )
36
38
mainWindow = createMainWindow ( )
37
39
38
- if ( os . platform ( ) === 'darwin' ) {
40
+ if ( platform === 'darwin' ) {
39
41
mainWindow . setSheetOffset ( 36 )
40
42
}
41
43
} )
42
44
43
45
app . on ( 'window-all-closed' , ( ) => {
44
- if ( process . platform !== 'darwin' ) {
46
+ if ( platform !== 'darwin' ) {
45
47
app . quit ( )
46
48
}
47
49
} )
48
50
49
51
app . on ( 'activate' , ( ) => {
50
52
if ( emeWindow . wins === 0 ) {
51
53
mainWindow = createMainWindow ( )
54
+ if ( platform === 'darwin' ) {
55
+ mainWindow . setSheetOffset ( 36 )
56
+ }
52
57
}
53
58
} )
54
59
0 commit comments