fix: vsync frame cap follows the active monitor's refresh rate #16

Merged
psk merged 2 commits from fix/vsync-active-monitor into master 2026-06-29 20:26:34 +00:00
Owner

For 0.3.2. VSync took the fps cap from the PRIMARY monitor's refresh and never updated when the window moved to another screen.

Fix: a small native-windowed frame limiter (system_settings.rs) -- while VSync is on it reads the refresh of whichever monitor the window's centre is on and spin-sleeps each frame to that rate; VSync off stays uncapped; gated out of wasm/headless.

Note: untestable in CI (needs a multi-monitor rig). Keys off window.position -- if Bevy doesn't update that on a manual drag between monitors, switch to WindowMoved events.

For 0.3.2. VSync took the fps cap from the PRIMARY monitor's refresh and never updated when the window moved to another screen. Fix: a small native-windowed frame limiter (system_settings.rs) -- while VSync is on it reads the refresh of whichever monitor the window's centre is on and spin-sleeps each frame to that rate; VSync off stays uncapped; gated out of wasm/headless. Note: untestable in CI (needs a multi-monitor rig). Keys off window.position -- if Bevy doesn't update that on a manual drag between monitors, switch to WindowMoved events.
fix: vsync frame cap follows the active monitor's refresh rate
Some checks failed
ci / build-and-test (pull_request) Has been cancelled
5f780f6cca
VSync took the fps cap from the PRIMARY monitor's refresh and never updated
when the window moved to another screen (AutoVsync/FIFO wasn't re-syncing on
monitor change), so e.g. a 144Hz primary kept the cap at 144 on a 60Hz
secondary.

Add a small native-windowed frame limiter (system_settings.rs): while VSync
is on it reads the refresh rate of whichever monitor the window's centre is
on and spin-sleeps each frame to that rate; VSync off stays uncapped. Gated
to non-wasm (the browser paces via rAF; the headless render uses a fixed
clock).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge branch 'master' into fix/vsync-active-monitor
All checks were successful
ci / build-and-test (pull_request) Successful in 8m56s
a677827d21
psk merged commit 1c7d30ec33 into master 2026-06-29 20:26:34 +00:00
psk deleted branch fix/vsync-active-monitor 2026-06-29 20:26:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
public/soundy-bits!16
No description provided.