mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
* ## Summary I've successfully fixed the nil pointer dereference bug in the Wails v3 system tray functionality on Windows. Here's what I addressed: **Root Cause**: The bug occurred in `systemtray_windows.go:80` where `*trayBounds = PhysicalToDipRect(*trayBounds)` was dereferencing a potentially nil pointer without checking. **Fixes Applied**: 1. **`positionWindow` method (lines 80-82)**: Added nil check for `trayBounds` before dereferencing 2. **`bounds` method (lines 121-123, 129-131)**: Added checks for uninitialized `hwnd` and nil return from `GetSystrayBounds` 3. **`iconIsInTrayBounds` method (lines 147-149, 155-157, 160-162)**: Added similar protective checks and taskbar position validation 4. **`getScreen` method (lines 173-175)**: Added `hwnd` initialization check 5. **`openMenu` method (lines 45-47)**: Added nil check for `trayBounds` **Key Improvements**: - Added proper initialization checks for `s.hwnd == 0` - Added nil pointer checks for all Windows API return values - Ensured graceful error handling instead of panics - Maintained existing functionality while preventing race conditions The fix addresses the race condition where system tray operations could be called before the tray was fully initialized, preventing the nil pointer dereference panic described in issue #4456. * Update changelog |
||
|---|---|---|
| .. | ||
| cmd/wails3 | ||
| examples | ||
| internal | ||
| pkg | ||
| scripts | ||
| tasks | ||
| test/docker | ||
| tests/window-visibility-test | ||
| wep | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc.yml | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
| release-notes.txt | ||
| release_notes.md | ||
| Taskfile.yaml | ||
| TESTING.md | ||
| UNRELEASED_CHANGELOG.md | ||
v3 Alpha
Thanks for wanting to help out with testing/developing Wails v3! This guide will help you get started.
Getting Started
All the instructions for getting started are in the v3 documentation directory: mkdocs-website.
Please read the README.md file in that directory for more information.