Skip to content

Mac/Metal: After alt-tab, get_current_texture locks for exactly one second #8309

@emilk

Description

@emilk

Description

When alt-tabbing between applications I notice that sometimes (often, not always) the wgpu app will wait a full second before showing up after being hidden.

Repro steps

  1. On Mac, run cargo r -p wgpu-example-02-hello-window.
  2. Use cmd-tab to switch to any other application that covers your entire screen (and more importantly: covers the wgpu-example).
  3. Use cmd-tab to switch back to the wgpu-example
  4. Observe that it takes exactly one second for the wgpu-example to show up

Expected vs observed behavior

Instant switching

Extra materials

Here's a screenshot of the stack trace after I added some extra profiling scopes:
Image

What is blocking is MetalLayerRef::next_drawable.

Platform

macOS Tahoe 26.0.1
wgpu 27.0.0

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: metalIssues with Metalhelp requiredWe need community help to make this happen.platform: macosIssues with integration with macostype: bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions