Skip to content

fix: paint root canvas in Win32 renderer - #4

Merged
dogukani merged 1 commit into
mainfrom
fix/root-canvas-paint
Sep 24, 2026
Merged

dogukani merged 1 commit into
mainfrom
fix/root-canvas-paint

Conversation

@dogukani

@dogukani dogukani commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Canvas apps with a canvas as the mounted root build on Windows but display a blank window. Win32 declines the batched present path, so the framework replays drawing into the canvas buffer. The native surface painter draws the root's children but skips the root canvas itself, and the repaint condition only counts canvas descendants.

Change

Paint a canvas root before its children and include it in the existing canvas repaint condition. Other root types keep the same path.

Verification

  • A fresh Balls Canvas build on merged main was blank at frame 60; existing Sky Hop and Canvas 3D captures showed the same issue.
  • With this change, all three apps built, rendered at frames 60 and 300, and exited 0. Canvas 3D rotated between frames 12 and 300.
  • Sky Hop accepted Windows mouse input: right movement and coin collection, button release, jump, and reset produced the expected visual states.
  • The Windows smoke verification passed, including the two button presses.
  • Notes JSX built and rendered its initial view.

The three example manifests do not currently declare Windows support. This fixes the observed canvas rendering gap when those apps are built for Windows.

Summary by CodeRabbit

  • Bug Fixes
    • Canvas content now renders correctly within its associated surface.
    • Surface updates continue while the owning canvas needs repainting, even when it has no child canvases.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0c6cc9bc-ac27-4b5c-a346-27576ccc97f5

📥 Commits

Reviewing files that changed from the base of the PR and between d14e787 and 4dbab4e.

📒 Files selected for processing (1)
  • packages/geastack-windows/targets/win32/main/win32_renderer.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Surface painting now draws a canvas owner into the surface client area. Surface synchronization also invalidates the surface when its owner is a canvas.

Changes

Canvas-owned surface rendering

Layer / File(s) Summary
Invalidate and paint canvas-owned surfaces
packages/geastack-windows/targets/win32/main/win32_renderer.cpp
syncSurface now invalidates when the surface owner is a canvas. paintSurface draws the owner’s canvas into the surface client area.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: dashersw

Merge Risk: ⚪ Minimal · up to 4dbab

The Win32 root-canvas path now paints the owner buffer before its descendants. No demonstrated rendering failure warrants holding the merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing root canvas painting in the Win32 renderer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@dogukani
dogukani merged commit 67cb15f into main Sep 24, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
@dogukani
dogukani deleted the fix/root-canvas-paint branch September 24, 2026 08:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant