Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions v3/UNRELEASED_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ After processing, the content will be moved to the main changelog and this file

## Fixed
<!-- Bug fixes -->
- Fix `Menu.Update()` not rebuilding the native menu on GTK4 Linux (#5659, independently diagnosed and fixed by @puneetdixit200 in #5539)
- Fix crash enumerating macOS screens on display change by copying screen id/name strings and snapshotting the count (#5565, independently diagnosed and fixed by @x-haose in #5584)
- Fix crash on Windows when `WM_ERASEBKGND` paints a solid background during a minimise/restore transition where `GetClientRect` returns nil (guard reported by @sinspired in #5636)
- Fix frontend bindings error always parses as text by @mbaklor in #5690
- Fix Windows build failure when using the `server` build tag, caused by Windows GUI files missing the `!server` build constraint that the macOS and Linux equivalents already have (#5680)

Expand Down
15 changes: 10 additions & 5 deletions v3/pkg/application/webview_window_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -1666,11 +1666,16 @@ func (w *windowsWebviewWindow) WndProc(msg uint32, wparam, lparam uintptr) uintp
if w.parent.options.BackgroundType == BackgroundTypeSolid {
col := w.parent.options.BackgroundColour
hdc := w32.HDC(wparam)
rc := w32.GetClientRect(w.hwnd)
colorRef := w32.COLORREF(uint32(col.Red) | uint32(col.Green)<<8 | uint32(col.Blue)<<16)
hbrush := w32.CreateSolidBrush(colorRef)
w32.FillRect(hdc, rc, hbrush)
w32.DeleteObject(w32.HGDIOBJ(hbrush))
// GetClientRect can legitimately return nil for a window in a
// transient state (minimise/restore transitions are especially
// prone to triggering it). FillRect with a nil rect crashes, so it
// must be checked before painting.
if rc := w32.GetClientRect(w.hwnd); rc != nil {
colorRef := w32.COLORREF(uint32(col.Red) | uint32(col.Green)<<8 | uint32(col.Blue)<<16)
hbrush := w32.CreateSolidBrush(colorRef)
w32.FillRect(hdc, rc, hbrush)
w32.DeleteObject(w32.HGDIOBJ(hbrush))
Comment thread
leaanthony marked this conversation as resolved.
}
}
return 1
// WM_UAHDRAWMENUITEM is handled by MenuBarWndProc at the top of this function
Expand Down
Loading