fix(v0.4.24): macOS ???? pystray,? vendored PyObjC ?? NSStatusItem+NSMenu ?? - #107
Merged
Conversation
…Menu 渲染 李工 2026-08-26 03:41 实测定案:pystray 0.19.5(2023-09 停更)在 macOS 26.6.2 上进程存活、无 traceback、NSStatusItem API 全通,但菜单栏图标不渲染。 排除链全实测(LSUIElement/PkgInfo/CFBundlePackageType/tray 链路零差异/ PyObjC 12.2.2 最新/启动方式)→ 定案渲染层弃 pystray。 - 新增 tray_macos.py:vendored PyObjC 直驱 NSStatusItem+NSMenu(5s NSTimer 主线程刷新、菜单动作代理 _ActionProxy、osascript 通知、状态/角标口径与 tray.py 完全一致) - tray.py main():darwin 分流 tray_macos.main()(单实例锁/Dock 隐藏/PID 文件前置);win32 保持 pystray 不变 - 版本 bump 0.4.23 -> 0.4.24 - 测试:test_tray_no_instance_starts 改回 win32 pystray 路径 + 新增 darwin 原生渲染两用例(分流 + 缺 PyObjC 兜底返回 2) - ruff/mypy 全绿;pytest 130 passed(1 e2e 失败为本机 Windows Temp 权限 环境问题,与本次改动无关)
|
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.



??(?? 2026-08-26 03:41 ????)
pystray 0.19.5(2023-09 ??,????)? macOS 26.6.2 ??????? traceback?NSStatusItem API ??,??????????????????:LSUIElement ?? / PkgInfo+CFBundlePackageType ??+lsregister / tray.py 0.4.18~0.4.23 pystray ????? / PyObjC 12.2.2 ?? wheel / ????????
??:macOS ??????? pystray,? vendored PyObjC ?? NSStatusItem + NSMenu;Windows ?? pystray(??,tray.py ??)?
??
??