fix: added warning for manual download on failed auto updates, simplified window lifecycle
This commit is contained in:
parent
a6833d5994
commit
713d6dba8f
@ -87,3 +87,4 @@ releaseInfo:
|
|||||||
Gemini 安全设置更新 @magicdmer
|
Gemini 安全设置更新 @magicdmer
|
||||||
智能体页面性能优化 @magicdmer
|
智能体页面性能优化 @magicdmer
|
||||||
修复 WebDAV 不能自动备份问题
|
修复 WebDAV 不能自动备份问题
|
||||||
|
⚠️ 如果不能自动更新,请手动下载安装包
|
||||||
|
|||||||
@ -14,7 +14,6 @@ export class WindowService {
|
|||||||
private static instance: WindowService | null = null
|
private static instance: WindowService | null = null
|
||||||
private mainWindow: BrowserWindow | null = null
|
private mainWindow: BrowserWindow | null = null
|
||||||
private miniWindow: BrowserWindow | null = null
|
private miniWindow: BrowserWindow | null = null
|
||||||
private isQuitting: boolean = false
|
|
||||||
private wasFullScreen: boolean = false
|
private wasFullScreen: boolean = false
|
||||||
private selectionMenuWindow: BrowserWindow | null = null
|
private selectionMenuWindow: BrowserWindow | null = null
|
||||||
private lastSelectedText: string = ''
|
private lastSelectedText: string = ''
|
||||||
@ -199,30 +198,25 @@ export class WindowService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private setupWindowLifecycleEvents(mainWindow: BrowserWindow) {
|
private setupWindowLifecycleEvents(mainWindow: BrowserWindow) {
|
||||||
// 监听应用退出事件
|
|
||||||
app.on('before-quit', () => {
|
|
||||||
this.isQuitting = true
|
|
||||||
})
|
|
||||||
|
|
||||||
mainWindow.on('close', (event) => {
|
mainWindow.on('close', (event) => {
|
||||||
const notInTray = !configManager.getTray()
|
// 如果已经触发退出,直接退出
|
||||||
|
if (app.isQuitting) {
|
||||||
|
return app.quit()
|
||||||
|
}
|
||||||
|
|
||||||
// Windows and Linux
|
// 没有开启托盘,且是Windows或Linux系统,直接退出
|
||||||
|
const notInTray = !configManager.getTray()
|
||||||
if ((isWin || isLinux) && notInTray) {
|
if ((isWin || isLinux) && notInTray) {
|
||||||
return app.quit()
|
return app.quit()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mac
|
|
||||||
if (!this.isQuitting) {
|
|
||||||
if (this.wasFullScreen) {
|
|
||||||
// 如果是全屏状态,直接退出
|
// 如果是全屏状态,直接退出
|
||||||
this.isQuitting = true
|
if (this.wasFullScreen) {
|
||||||
app.quit()
|
return app.quit()
|
||||||
} else {
|
}
|
||||||
|
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user