Skip to content

Commit 74a4d17

Browse files
committed
call setSheetOffset after recreated the main window
1 parent 835b986 commit 74a4d17

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const buildMenu = require('./eme/menu')
1313
const emeWindow = require('./eme/window')
1414
const config = require('./eme/config')
1515

16+
const platform = os.platform()
17+
1618
const appMenu = buildMenu({
1719
createWindow: emeWindow.createWindow
1820
})
@@ -22,7 +24,7 @@ const createMainWindow = () => {
2224
defaultWidth: 800,
2325
defaultHeight: 600
2426
})
25-
if (process.platform === 'linux') {
27+
if (platform === 'linux') {
2628
windowState.icon = path.join(__dirname, 'resources/icon.png')
2729
}
2830
const win = emeWindow.createWindow({windowState})
@@ -35,20 +37,23 @@ app.on('ready', () => {
3537
Menu.setApplicationMenu(appMenu)
3638
mainWindow = createMainWindow()
3739

38-
if (os.platform() === 'darwin') {
40+
if (platform === 'darwin') {
3941
mainWindow.setSheetOffset(36)
4042
}
4143
})
4244

4345
app.on('window-all-closed', () => {
44-
if (process.platform !== 'darwin') {
46+
if (platform !== 'darwin') {
4547
app.quit()
4648
}
4749
})
4850

4951
app.on('activate', () => {
5052
if (emeWindow.wins === 0) {
5153
mainWindow = createMainWindow()
54+
if (platform === 'darwin') {
55+
mainWindow.setSheetOffset(36)
56+
}
5257
}
5358
})
5459

0 commit comments

Comments
 (0)