Skip to content

Request renders for native X11 and WinAPI damage - #55

Merged
levovix0 merged 22 commits into
levovix0:masterfrom
elcritch:fix/native-damage-redraw
Sep 14, 2026
Merged

levovix0 merged 22 commits into
levovix0:masterfrom
elcritch:fix/native-damage-redraw

Conversation

@elcritch

Copy link
Copy Markdown
Contributor

X11 Expose events are currently ignored, and WinAPI WM_PAINT only requests a render when the client size changes. A damaged window can therefore miss onRender even when the application services it normally.

Schedule a redraw for the affected window on X11 exposure and on WinAPI paint damage, including when the size is unchanged. Internal WM_PAINT messages with an empty update region do not request a frame. Rendering continues through the existing serviceWindow / onRender path.

This lets consumers such as Merenda remove their blanket repaint-after-activity fallback and rely on application invalidation plus native damage. Event-loop wakes and unrelated native events do not themselves request redraws. Related to #54.

Extend t_event_loop.nim with coverage for coalesced wakes, explicit redraws, unrelated native activity, native damage combined with a wake in either order, unchanged sizes, and isolation between two windows. The Windows coverage also checks an internal paint without damage. Update the README to explain the render contract.

Validation from Merenda's Atlas workspace:

  • atlas-run tests deps/siwin/tests/t_event_loop.nim passed on macOS.
  • nim check --os:linux deps/siwin/tests/t_event_loop.nim passed.
  • nim check --os:windows deps/siwin/tests/t_event_loop.nim passed.

Native X11 and Windows runtime cases were not executed locally. No full suite was run locally.

@levovix0
levovix0 merged commit fdec8e4 into levovix0:master Sep 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants