Surface Frames

July 19, 2026

It's a short video today, but one that I've been looking forward to. In this devlog, we level up from stationary / unchanging surfaces to animated ones by making use of Wayland Surface's frame request and callback mechanism. One of the best parts about this is that it unlocks our ability to make our test clients interactive, opening up the number of things we're able to work on next.

Frame Request

The wl_surface object has a frame request available on it that drives the animation loop on the clients. At a high-level, the frame request gets submitted with each surface commit. The frame request basically says "hey, let me know when you're ready for the next frame". The client will then sit there and wait -- no point in creating and sending new commits if the compositor isn't ready to draw them on the screen.

Callbacks

The wl_callback object is how the compositor will let the client know it's ready for the next frame. It does this by emitting the done event on the associated frame, for which the client has a handler set up that does another re-render and commit. By putting the decision for when to get another client frame in the hands of the compositor, this allows the compositor to ensure clients are synchronized with the display's refresh rate, and that the clients aren't unnecessarily rendering when they may not even be visible at the time.

Related Links

Here's the PR for these changes: Github PR #6

There are also protocol reference pages for the interfaces discussed in this video: