Skip to content

Fix DOM canvas resize synchronization - #355

Merged
waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:window-resize-all
Jul 24, 2026
Merged

Fix DOM canvas resize synchronization#355
waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:window-resize-all

Conversation

@waynemwashuma

Copy link
Copy Markdown
Collaborator

Objective

Fix DOM window resize handling so canvas-backed windows stay synchronized with their rendered size and emit resize events from scheduled window state updates instead of DOM resize events on the canvas.

Solution

  • Remove the old setUpWindowEvents listener because resize events are not a reliable canvas event source for DOM canvas size changes.
  • Add syncWindowSize during window registration to initialize both the canvas backing size and styled size from the Window component.
  • Add a resizeWindow system to check registered canvases and update their Window component when the DOM size changes.
  • Update WindowResize to receive explicit width and height values instead of reading them from a UIEvent.
  • Update window resize commands to apply style dimensions, read the final bounding rect, sync the canvas backing buffer, and update the Window resource consistently.

Showcase

Before

Resize events depended on manually dispatched canvas events, and WindowResize extracted size from the event target.

After

Resize state is detected by the DOM window system and emitted with explicit dimensions.

Migration guide

No breaking changes

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this Jul 24, 2026
@waynemwashuma waynemwashuma added the type:bug Something isn't working label Jul 24, 2026
@waynemwashuma
waynemwashuma merged commit d666e8e into wimaengine:dev Jul 24, 2026
7 checks passed
@waynemwashuma
waynemwashuma deleted the window-resize-all branch July 24, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:window type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant