Conversation
A compositor sends no frame callbacks to a surface it has suspended, so a client presenting with vsync blocks until the window is shown again. Winit stopped reporting this state as `WindowEvent::Occluded` in rust-windowing#3441: every configure also requested a redraw so the acknowledgement would be committed, and drawing on the configure that suspends the window blocked. Emit `Occluded` again when the `suspended` state is added or removed, and add `WindowExtWayland::notify_presentation_paused`, as proposed in rust-windowing#3442. An application calls it after it has stopped presenting on `Occluded(true)`. Winit then commits the surface itself for the pending configure (sctk has already acknowledged it) and for every later configure while the window stays suspended, instead of asking for a redraw. The configure that ends the suspension asks for a redraw as before, and the next `Occluded(true)` needs a new call. Winit leaves the commit to the application when the integer buffer scale changed since the call, because the new scale would apply to the old buffer, whose size need not be a multiple of it. An application that never calls the method behaves as before: every configure, including the suspending one, asks for a redraw. Refs rust-windowing#3442
crmne
force-pushed
the
wayland-suspended-occluded-0.30
branch
from
September 25, 2026 08:59
732fa2f to
a51e41b
Compare
4 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #4709 to the 0.30 maintenance branch, where eframe/egui and many other applications still are:
WindowEvent::Occluded(true/false)is emitted when the xdg-shell v6suspendedstate is added or removed.WindowExtWayland::notify_presentation_paused(). After an app calls it, winit commits the suspended window's configures itself instead of asking for a redraw, until the window stops being suspended.Tested the same way as #4709, with the same results on headless Jay and Hyprland 0.56.2. A probe that keeps presenting on every redraw gets the same redraw and paint counts as stock v0.30.x.
CI on v0.30.x currently fails before compiling:
cargo update -p syn --precise 2.0.114is ambiguous now that syn 3 exists (see #4692).changelogmodule if knowledge of this change could be valuable to users