diff --git a/app/ipcMainSets.js b/app/ipcMainSets.js index 63aae18..7b0332a 100644 --- a/app/ipcMainSets.js +++ b/app/ipcMainSets.js @@ -222,13 +222,15 @@ module.exports = function (mainWindow, backgroundWindow) { ipcMain.on('sync-close', (event, arg) => { mainWindow.close() }) + + // 默认窗口大小,当不指定 x,y 时,则为居中。 + let windowBounds = { + width: 1280, + height: 850 + } ipcMain.on('sync-maximize', (event, arg) => { - let windowBounds = { - width: 1280, - height: 850 - } if (mainWindow.isMaximized()) { - mainWindow.setBounds(windowBounds) + mainWindow.setBounds(windowBounds, true) } else { windowBounds = mainWindow.getBounds() mainWindow.maximize()