Skip to content

1s delay when calling present on occluded window on macOS #5226

@jnb

Description

@jnb

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

  1. 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

  1. 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.

  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: wsiIssues with swapchain management or windowingbackend: metalIssues with Metalexternal: upstreamIssues happening in lower level APIs or platformshelp requiredWe need community help to make this happen.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions