Repository navigation
fix(v3/windows): systray panic - #5703
Conversation
WalkthroughTwo error-handling fixes in Windows System Tray Error Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
cc @leaanthony - I see you are very busy :-) ... This one too please. |
Description
When Explorer / the taskbar restarts, the tray icon is de-registered until the TaskbarCreated handler (reshowSystrays) re-adds it (~1s debounce). A SetIcon in that window reaches updateIcon
Shell_NotifyIcon(NIM_MODIFY) fails -> panic(syscall.GetLastError()).
When the thread's last-error is 0, GetLastError() is nil, in Go this is panic(nil) -> "panic called with nil argument", crashing the host app.
Apps that update the tray on a timer hit this; others rarely do.
Fixes # (issue)
1: Fix don not panic(nil) in systray updateIcon when NIM_MODIFY fails
2: Fix nil-deref in destroy()
Please select the option that is relevant.
How Has This Been Tested?
Stack trace from user:
If you checked Linux, please specify the distro and version.
Test Configuration
Please paste the output of
wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Summary by CodeRabbit