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

examples: Call pre_present_notify before presenting #7074

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

kjarosh
Copy link
Contributor

@kjarosh kjarosh commented Feb 6, 2025

According to winit docs, pre_present_notify() should be called right before calling present().

This actually prevents some issues on Wayland, like freezing the whole application when the window is not visible (ask me how I know).

See ruffle-rs/ruffle#19456

Testing

Tested by running examples on Wayland. It's enough to add a dbg! in about_to_wait to observe the difference. Without this patch nothing's logged when the window is not visible, because the event loop is blocked due to present() not returning.

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@kjarosh kjarosh requested a review from a team as a code owner February 6, 2025 22:29
@kjarosh kjarosh force-pushed the winit-pre-present-notify branch from 81cadad to 5049730 Compare February 6, 2025 22:31
According to winit docs, pre_present_notify() should be called right
before calling present().

This actually prevents some issues on Wayland, like freezing the whole
application when the window is not visible (ask me how I know).
@kjarosh kjarosh force-pushed the winit-pre-present-notify branch from 5049730 to 7015a2a Compare February 6, 2025 22:33
@nical nical enabled auto-merge (squash) February 10, 2025 08:07
@nical nical merged commit 43eb6c9 into gfx-rs:trunk Feb 10, 2025
33 checks passed
@kjarosh kjarosh deleted the winit-pre-present-notify branch February 10, 2025 12:50
davnotdev pushed a commit to davnotdev/wgpu that referenced this pull request Mar 4, 2025
According to winit docs, pre_present_notify() should be called right
before calling present().

This actually prevents some issues on Wayland, like freezing the whole
application when the window is not visible (ask me how I know).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants