You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows tray icons incorrectly load multi-image ICO files #5961
On Windows, SystemTray.SetIcon and application/window icon loading handle PNG bytes correctly but pass a complete multi-image ICO container directly to CreateIconFromResourceEx. That API expects the bytes of one RT_ICON image resource, not the ICO file header, directory, and all image entries. As a result, .ico files can fail to load or render/select incorrectly in the system tray.
v3/pkg/w32/icon.go recognizes the ICO signature, but CreateSmallHIconFromImage and CreateLargeHIconFromImage pass the entire file buffer to CreateIconFromResourceEx. ICO files need to be parsed and the best matching ICONDIRENTRY payload extracted first.
Scope
Parse the ICO header and directory safely.
Select the best image for the requested Windows system metric, preferring the closest size that does not exceed it and then color depth.
Pass only the selected PNG/DIB image payload to CreateIconFromResourceEx.
Preserve direct PNG support.
Cover multi-image selection, 256-pixel entries, malformed bounds, and actual HICON creation with tests.
Acceptance criteria
Multi-image ICO bytes produce a non-null Windows HICON.
The closest suitable image entry is selected deterministically.
Malformed ICO offsets and lengths return an error without panicking.
#4653 - [v3 alpha] windows tray minor refactor [merged] #4706 - Fix Windows systray icon regression [merged] #5576 - fix(v3/windows): show dialogs with icons in dev builds and keep their buttons [merged] #5627 - test(v3/icons): assert .ico is small, not an exact byte size [merged] #5703 - fix(v3/windows): systray panic [merged]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Aug 12, 2026
🔗 Related PRs
#4653 - [v3 alpha] windows tray minor refactor [merged]
#4706 - Fix Windows systray icon regression [merged]
#5576 - fix(v3/windows): show dialogs with icons in dev builds and keep their buttons [merged]
#5627 - test(v3/icons): assert .ico is small, not an exact byte size [merged]
#5703 - fix(v3/windows): systray panic [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
nik9play commentedon Aug 12, 2026
Closing because this issue was opened prematurely during local investigation. The fix remains local and unsubmitted.