Skip to content

fix(windows): draw nothing of a partial frame whose areas lie outside the window - #2764

Merged
oneo-me merged 1 commit into
mainfrom
agiox/fix-nsgo-issue-2757
Nov 29, 2026
Merged

oneo-me merged 1 commit into
mainfrom
agiox/fix-nsgo-issue-2757

Conversation

@oneo-me

@oneo-me oneo-me commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A Windows window panicked with index out of range [0] with length 0 in (*painter).pushAreas when a partial frame had no areas to draw: everything it changed lay outside the client area and the frame before changed nothing. pushAreas now keeps its areas non-nil but empty, so the pass skips the whole tree, and clips to an empty rectangle, so it draws nothing.

Fixes #2757.

Targets

  • Shared code (core, base, ui, tsx, the nsgo tool)
  • macOS
  • iOS
  • tvOS
  • watchOS
  • Android
  • Windows
  • Linux
  • Web
  • Mini programs
  • Docs or website only

Only the Windows backend clips a frame to its damaged areas this way.

Screenshots

None

Verification

  • head: fd67f8570962ea8987b0c9438e3d5697a3505a43
  • base: 825b87380905c82316a3856e3de8dbce56e25296
  • commands:
    • go tool nsgo check → 0
    • go tool nsgo check -target windows -jobs 4 → 0
    • go tool nsgo test → 0
  • result: pass
  • not covered: the Windows test job, the emulator, browser and other-OS jobs. On a Windows 11 machine, a cross-compiled test binary for internal/platform/windows passed TestPartialFrameWithNoAreasDrawsNothing, TestCanvasArgumentsQueueWhatTheyChange and TestRedrawAllDrawsTheWholeWindow; the new test panicked as in the issue without the fix.

Checklist

  • The title is a Conventional Commit, such as fix(linux): keep the caret after a paste; a squash merge uses it as the commit subject.
  • Docs whose facts change are updated, and a capability users can see has a line in a changelog.d/ fragment, not in CHANGELOG.md.
  • New third-party code, assets and dependencies name their source and license.

🤖 Claude Opus 5.5

🤖 Generated with Claude Code

@oneo-me oneo-me self-assigned this Nov 29, 2026
@github-actions github-actions Bot added size/XS bug Something isn't working local-ci-skipped labels Nov 29, 2026
… the window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneo-me
oneo-me force-pushed the agiox/fix-nsgo-issue-2757 branch from 8d893b8 to fd67f85 Compare November 29, 2026 12:11
@github-actions github-actions Bot added documentation Improvements or additions to documentation Windows size/XS size/S and removed size/XS labels Nov 29, 2026
@oneo-me
oneo-me marked this pull request as ready for review November 29, 2026 12:12
@github-actions github-actions Bot added local-ci-pass The head commit declares that its local checks passed and removed size/XS local-ci-skipped labels Nov 29, 2026
@oneo-me
oneo-me merged commit 40d2b3f into main Nov 29, 2026
52 of 53 checks passed
@oneo-me
oneo-me deleted the agiox/fix-nsgo-issue-2757 branch November 29, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation local-ci-pass The head commit declares that its local checks passed size/S Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(windows): panic in (*painter).pushAreas when areas slice is empty (damage.go:417)

1 participant