mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-16 12:08:12 +00:00
perf: 主窗口可以单独关闭到后台
This commit is contained in:
parent
ae32b3c525
commit
ed57411bbb
8
electron/electron.js
vendored
8
electron/electron.js
vendored
@ -68,7 +68,7 @@ function createMainWindow() {
|
||||
if (process.platform === 'win32') {
|
||||
mainWindow.hide()
|
||||
} else if (process.platform === 'darwin') {
|
||||
app.hide()
|
||||
mainWindow.hide()
|
||||
} else {
|
||||
app.quit()
|
||||
}
|
||||
@ -195,7 +195,11 @@ if (!getTheLock) {
|
||||
}
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createMainWindow()
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createMainWindow()
|
||||
} else if (!mainWindow.isVisible()) {
|
||||
mainWindow.show()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user