Skip to content

VSync does not seem to adapt to the window changing between monitors of different refresh rates #7663

@natanfudge

Description

@natanfudge

Description
If you have a 144hz monitor, and a 60hz monitor, and you move the window from the 144hz monitor to 60hz monitor, the frame rate will stay at 144 fps.

Repro steps

  1. Run the 02_hello_window sample, and add some code that tracks the time between frames, here is a full example:
    https://gist.github.com/natanfudge/fa88596706e51b6e55903c06d58e035d
  2. Make sure to run the window initially on a screen with some refresh rate (e.g. 144) by setting that screen to be your primary screen.

Observe prints:

Time since last frame: 6.821ms
Time since last frame: 6.9617ms
Time since last frame: 6.8569ms
Time since last frame: 7.331ms
  1. Move the window to a different monitor with a different refresh rate (e.g. 60)
  2. Observe prints (same, with some small variation obv):
Time since last frame: 6.821ms
Time since last frame: 6.9617ms
Time since last frame: 6.8569ms
Time since last frame: 7.331ms

Actual Behavior
Frame rate stays at the initial one (144 fps, 7ms seconds per frame)
Expected Behavior
Frame rate adapts to the change in monitor and changes (to 60 fps, 16.6ms per frame)

Platform
Windows 11
wgpu 25.0.1

Extra Notes

  • This behaves correctly with GLFW + OpenGL.
  • I have tried solving this in many ways, reconfiguring surface, recreating surface, restarting window but I did not manage to make it work as expected.
  • If there is some configuration that makes this work, please let me know (using GLFW)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions