Skip to content

[0.30] Wayland: emit Occluded for the xdg-shell suspended state - #4710

Open
crmne wants to merge 1 commit into
rust-windowing:v0.30.xfrom
crmne:wayland-suspended-occluded-0.30
Open

crmne wants to merge 1 commit into
rust-windowing:v0.30.xfrom
crmne:wayland-suspended-occluded-0.30

Conversation

@crmne

@crmne crmne commented Sep 23, 2026 •

Copy link
Copy Markdown

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 v6 suspended state is added or removed.
  • New 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.
  • Apps that don't call it behave as before.

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.114 is ambiguous now that syn 3 exists (see #4692).

  • Tested on all platforms changed (Wayland)
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

@crmne
crmne requested a review from kchibisov as a code owner September 23, 2026 12:38
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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant