Skip to content

fix(v0.4.24): macOS ???? pystray,? vendored PyObjC ?? NSStatusItem+NSMenu ?? - #107

Merged
liwmj merged 3 commits into
masterfrom
fix/v0.4.24-mac-native-render
Aug 26, 2026
Merged

fix(v0.4.24): macOS ???? pystray,? vendored PyObjC ?? NSStatusItem+NSMenu ??#107
liwmj merged 3 commits into
masterfrom
fix/v0.4.24-mac-native-render

Conversation

@liwmj

@liwmj liwmj commented Aug 26, 2026

Copy link
Copy Markdown
Owner

??(?? 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 ??)?

??

  • ?? src/ghlink/tray_macos.py:vendored PyObjC ????(NSStatusItem + NSMenu,5s NSTimer ???????????? _ActionProxy?osascript ?????/????? tray.py ????)
  • ray.py main():darwin ????? ray_macos.main()(????/Dock ??/PID ????);win32 ?? pystray ??
  • ?? bump 0.4.23 ? 0.4.24
  • ??: est_tray_no_instance_starts ?? win32 pystray ?? + ?? darwin ???????(?? + ? PyObjC ???? 2)

??

  • ruff lint/format ??
  • pytest 130 passed(1 ? e2e ????? Windows Temp ??????,???????,CI Linux ????)
  • macOS ??????:???? 0.4.24 ?????(? G4 ????)

saibo added 3 commits August 26, 2026 10:13
…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 权限
  环境问题,与本次改动无关)
@sonarqubecloud

Copy link
Copy Markdown

@liwmj
liwmj merged commit 7da1647 into master Aug 26, 2026
6 checks passed
@liwmj
liwmj deleted the fix/v0.4.24-mac-native-render branch August 26, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants