rust-windowing / rust-windowing/winit

On MacOS frame-rate *may* be slightly unstable due to where `RedrawRequested` is issued.

Open
#1,978 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug C - needs investigation DS - appkit
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

This is subtle and may be localized to my computer or version of MacOS, but I thought it was worth reporting.

I use my own library that is similar to winit and I noticed visual stutter. When diagnosing it I realized that moving where the RedrawRequested event was issued from the end of the event loop to be in response to drawRect made the frame-rate timings more stable.

I decided to check winit for comparison so I setup a test repository for glutin / winit that logs the time between frames. I noticed that winit's frame-times match the stuttering in my library (before the fix).

It's also possible that it is the timings alone that are off and that there's no actual visual issue with winit / glutin.

Here's my test repository for glutin where the issue is reproduced: https://github.com/kettle11/winit_framerate_test

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked glutin/winit frame-rate test on macOS and comparing its logged frame intervals. Inspect where winit issues RedrawRequested relative to drawRect and the end of the event loop; done would be documenting whether the timing difference is reproducible and identifying the relevant behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.