Skip to content

Implement VSync source #2412

@kchibisov

Description

@kchibisov

This is a common concept in e.g. browsers to have non blocking frame scheduling at the display refresh rate.

It seems like it's possible on all desktop platforms and the web. For the rest we may indicate that vsync source is not supported.

The way to integrate it would be to add WindowEvent::Frame which must be send when the new frame is ready to be drawn. That will come from the compositor directly and the users must request those event via Window::request_frame() -> Result<()>, where the result will indicate that the event can't be scheduled due to reasons.

The Api that should be used for that on platform are the following.

X11 - Xpresent
macOS - DisplayLink
Wayland - frame callbacks
Windows - DWM get composition timings + a timer.
Web - request animation frame.

The Api is essential for Wayland clients, since they must not rely on vsync from the graphics Api.

Metadata

Metadata

Assignees

Labels

DS - appkitAffects the AppKit/macOS backendDS - win32Affects the Win32/Windows backendDS - x11Affects the X11 backend, or generally free Unix platformsS - apiDesign and usability

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions