Skip to content

Window/timing: expose the display refresh rate (AppWindow.RefreshRate)#34

Merged
codymullins merged 1 commit into
mainfrom
feat/refresh-rate
Jun 18, 2026
Merged

Window/timing: expose the display refresh rate (AppWindow.RefreshRate)#34
codymullins merged 1 commit into
mainfrom
feat/refresh-rate

Conversation

@codymullins

Copy link
Copy Markdown
Contributor

Addresses #11 (the vsync-clock part).

A browser paces requestAnimationFrame and CSS animation to the display's refresh rate. Skyline exposed frame delta but not the rate itself.

What changed

  • AppWindow.RefreshRate (double, Hz) → IWindowBackend.RefreshRate.
  • AppKit backend — the window's screen rate via NSScreen.MaximumFramesPerSecond (accurate, including ProMotion 120 Hz).
  • GLFW backend — the window's monitor rate via VideoMode.RefreshRate when GLFW knows it (set in fullscreen), otherwise 60.

Scope

This is the vsync-clock slice of #11. The other two parts — per-frame wheel-event coalescing and normalized/typed scroll deltas — touch the input event shape and are left as follow-up, so #11 stays open. Used "Addresses" not "Closes."

Tests

  • Skyline.WindowedTests — reads RefreshRate on the default (AppKit) window and on the GLFW chrome-mode windows, asserting a positive rate (covers both backend paths).

Verification

  • dotnet build Skyline.slnx clean (0 warnings); Skyline.Apple builds clean on the macos workload.
  • Headless tests pass; windowed harness passes (91 checks); format-check.sh clean.
  • Coverage: GlfwWindowBackend 100%; AppWindow 96.9% (matches main — the new one-line property is covered). Overall 98% matches main.

Note

Touches the window seam, so it overlaps the open window PRs (#30/#31/#32) in IWindowBackend/AppWindow/GLFW/FakeBackend/harness. Edits are in distinct regions, so conflicts are trivial rebases as PRs land.

Add AppWindow.RefreshRate (Hz) so a shell can pace animation to the
display. On macOS it is the window's screen rate; on GLFW it is the
window's monitor rate when known (set in fullscreen), otherwise 60.

Addresses #11 (the vsync-clock piece). Wheel coalescing and normalized
scroll deltas remain.
Copilot AI review requested due to automatic review settings June 16, 2026 23:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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