-
Notifications
You must be signed in to change notification settings - Fork 1.3k
1s delay when calling present on occluded window on macOS #5226
Description
Description
When calling present on a recently occluded window on macOS, there's an approximate 1s delay before the present call returns.
Watching for the Occluded event (and then suppressing updates) is insufficient because the Occluded event arrives after we've already encountered the delay.
Repro steps
- Run any of the wgpu examples that continuously present e.g.
cargo run --bin wgpu-examples boids
cargo run --bin wgpu-examples bunnymark
cargo run --bin wgpu-examples water
-
Position the example window over another background window (e.g. a terminal), such that the background window will entirely cover the example window when we switch to it.
-
Switch to the background window (e.g. using cmd-tab) so that the example window is entirely occluded, and then quickly switch back to the example window (cmd-tab again). There is a 1s delay before the example window re-appears.
Expected vs observed behavior
Expected: switching back to the previously-backgrounded example window should be instantaneous.
Actual: there's an approximate 1s delay to switch back to the previously backgrounded window.
Platform
- macOS 13.2.1
- wgpu HEAD