Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occluded change must be synced with winit #3442

Open
kchibisov opened this issue Jan 29, 2024 · 2 comments
Open

Occluded change must be synced with winit #3442

kchibisov opened this issue Jan 29, 2024 · 2 comments

Comments

@kchibisov
Copy link
Member

State change on Wayland, demands confirmation in form of ack + commit, commit usually done when drawing, however when using Vsync extension drawing will block indefinitely when you'll have Occluded event.

To solve that winit must have a way to commit on-behalf of the users, however doing so unconditionally will break clients and may result in desyncs, but asking them to draw and then send Occluded is also not an option, thus Occluded itself should ask whether the user stopped their rendering/continued their rendering, thus on stop winit can do wl_surface::commit.

This issue is also kind of present with other state changes, and not really specific to occluded, however occluded is the only where it really matters.

Until it's resolved it winit will remove the handling of this event.

@kchibisov kchibisov added this to the Version 0.31.0 milestone Jan 29, 2024
kchibisov added a commit that referenced this issue Jan 30, 2024
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.

Links: #3442
kchibisov added a commit that referenced this issue Feb 13, 2024
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.

Links: #3442
kchibisov added a commit to kchibisov/winit that referenced this issue Feb 17, 2024
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.

Links: rust-windowing#3442
kchibisov added a commit that referenced this issue Feb 26, 2024
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.

Links: #3442
@mahkoh
Copy link
Contributor

mahkoh commented Apr 19, 2024

To solve that winit must have a way to commit on-behalf of the users

Reasonably sure that this is not possible because any WSI takes exclusive ownership of this. Only the WSI may call commit.

@kchibisov
Copy link
Member Author

Reasonably sure that this is not possible because any WSI takes exclusive ownership of this. Only the WSI may call commit.

It's possible if you communicate correctly, wsi can not commit on its own either, you have to call into present function, and if you indicate such a change with a callback you can certainly do so on behalf of the user, because they indicated that they won't commit..

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

No branches or pull requests

2 participants