From 2033a7cc1e6d22c6bfd38f903bb2fb4b006b6e6c Mon Sep 17 00:00:00 2001 From: zhang-pu <69795881+zhang-pu@users.noreply.github.com> Date: Mon, 2 Nov 2026 12:05:17 +0800 Subject: [PATCH] fix: pystray setup callback signature (pystray passes icon as arg) --- system_monitor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system_monitor.py b/system_monitor.py index d18d063..067ee39 100644 --- a/system_monitor.py +++ b/system_monitor.py @@ -280,7 +280,10 @@ def main(): ) app.icon = icon - def _tick(): + def _tick(icon_arg=None): + # pystray 会把 icon 作为参数传给 setup 回调 + if icon_arg is not None: + icon_arg.visible = True app.refresh() return True