Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
修复 macOS 上应用退出后系统托盘图标被 FrontBoard 判定为
after-life.interrupted、经 MenuBarAgent 复活,表现为「退出后自动重开」的问题。原实现只在
RunEvent::Exit统一移除托盘图标,无法可靠覆盖所有退出路径。本次将移除时机拆分为两处:RunEvent::ExitRequested:覆盖托盘 Quit(app.exit)与自更新 relaunch(request_restart)两条路径。此刻事件循环仍会至少再跑一轮,足够让状态栏图标的跨进程注销真正落地。RunEvent::Exit:Cmd+Q(原生[NSApp terminate:],不触发ExitRequested)唯一能拿到的收尾时机,作为兜底;对已移除的托盘重复调用为无副作用空操作。额外为 macOS 补充TRAY_EXIT_GRACE_MS(150ms)延迟,换取跨进程注销生效的经验窗口(数值来自实测,非文档承诺)。改动文件
src-tauri/src/lib.rs:拆分ExitRequested/Exit处理,新增 macOS 退出延迟常量TRAY_EXIT_GRACE_MSsrc-tauri/src/tray.rs:同步更新remove_trays文档注释,说明双路径调用约定验证
🤖 Generated with Claude Code