Repository navigation
On Wayland, disable Occluded handling - #3441
Merged
kchibisov merged 1 commit intoJan 30, 2024
Merged
Conversation
kchibisov
force-pushed
the
stupid-commit-all-over-the-place
branch
from
January 29, 2024 17:20
bfe4a71 to
9d737a8
Compare
Change in state requires a redraw, however drawing when getting `Occluded` with vsync will block indefinitely, thus the event in it's current state is rather useless. To solve this issue winit needs a way to determine whether the user paused/continued their render loop, so it can commit on their behalf. This commit also forces redraw when getting configure.
kchibisov
force-pushed
the
stupid-commit-all-over-the-place
branch
from
January 29, 2024 18:10
9d737a8 to
626477a
Compare
crmne
added a commit
to crmne/winit
that referenced
this pull request
Sep 23, 2026
A compositor sends no frame callbacks to a surface it has suspended, so a client presenting with vsync blocks in eglSwapBuffers until the window is shown again. Toolkits built on winit already stop rendering on `WindowEvent::Occluded(true)`, but winit stopped emitting it on Wayland in rust-windowing#3441, because every configure also requested a redraw to commit the acknowledgement, and that redraw blocked. Emit `Occluded` again when the `suspended` state is added or removed, and don't request a redraw for a configure that leaves the window suspended. xdg-shell lets the client acknowledge several configures and commit only the last, so the first frame after the suspension ends commits it; that configure requests a redraw as before. Refs rust-windowing#3442
3 of 4 tasks
crmne
added a commit
to crmne/winit
that referenced
this pull request
Sep 25, 2026
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
added a commit
to crmne/winit
that referenced
this pull request
Oct 14, 2026
A compositor sends no frame callbacks to a surface it has suspended, for example on a hidden workspace or while the outputs are off. Winit stopped reporting this state as `WindowEvent::Occluded` in rust-windowing#3441, together with the change that made the suspending configure ask for a redraw. Emit `Occluded(true)` and `Occluded(false)` again when the `suspended` state is added or removed. Winit still asks for a redraw after every configure, including the suspending one, and never commits on the application's behalf, so applications that ignore the event behave as before. Refs rust-windowing#3442
crmne
added a commit
to crmne/winit
that referenced
this pull request
Oct 14, 2026
A compositor sends no frame callbacks to a surface it has suspended, for example on a hidden workspace or while the outputs are off. Winit stopped reporting this state as `WindowEvent::Occluded` in rust-windowing#3441, together with the change that made the suspending configure ask for a redraw. Emit `Occluded(true)` and `Occluded(false)` again when the `suspended` state is added or removed. Winit still asks for a redraw after every configure, including the suspending one, and never commits on the application's behalf, so applications that ignore the event behave as before. Refs rust-windowing#3442
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.
Change in state requires a redraw, however drawing when getting
Occludedwith vsync will block indefinitely, thus the event in it's current state is rather useless.To solve this issue winit needs a way to determine whether the user paused/continued their render loop, so it can commit on their behalf.
CHANGELOG.mdif knowledge of this change could be valuable to users