Frameless Window

This commit is contained in:
2025-06-09 01:00:15 +08:00
parent 8522a47b5f
commit 7f97b4a937
12 changed files with 999 additions and 17 deletions

View File

@@ -29,15 +29,8 @@ func RegisterTrayEvents(app *application.App, systray *application.SystemTray, m
trayService.HandleWindowClose()
})
// 处理窗口最小化事件 - 根据配置决定是隐藏到托盘还是正常最小化
mainWindow.RegisterHook(wailsevents.Common.WindowMinimise, func(event *application.WindowEvent) {
if trayService.ShouldMinimizeToTray() {
// 取消默认最小化行为,隐藏到托盘
event.Cancel()
trayService.HandleWindowMinimize()
}
// 如果不启用托盘,允许正常最小化(不取消事件)
})
// 不再拦截窗口最小化事件,让任务栏点击保持正常行为
// 最小化到托盘的逻辑由前端标题栏按钮直接处理
}
// RegisterTrayMenuEvents 注册系统托盘菜单事件