single
This commit is contained in:
parent
c8c60e693f
commit
c4703eb5ba
6
main.js
6
main.js
@ -479,10 +479,7 @@ function createMenu() {
|
||||
mainWindow.setMenu(menu);
|
||||
}
|
||||
}
|
||||
|
||||
function createMainWindow = () => {
|
||||
|
||||
// 实现单例,在启动第二个实例后,激活主窗口,然后退出第二个实例
|
||||
// 实现单例,在启动第二个实例后,激活主窗口,然后退出第二个实例
|
||||
const shouldQuit = app.makeSingleInstance(() => {
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
@ -492,6 +489,7 @@ const shouldQuit = app.makeSingleInstance(() => {
|
||||
|
||||
shouldQuit && app.quit()
|
||||
|
||||
const createMainWindow = () => {
|
||||
var mainWindowState = windowStateKeeper({
|
||||
defaultWidth: 1300,
|
||||
defaultHeight: 700,
|
||||
|
Loading…
x
Reference in New Issue
Block a user