bevyengine / bevyengine/bevy

panicked at 'No surface found for window.'

Open
#3,248 1 comment 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug I-Regression
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

git head 4423a2fa2dc82fad71525ed3f44e16b8481a4902

## Operating system & version

Windows 10

## What you did

When minimizing windows, panicked at 'No surface found for window.'

## What you expected to happen

The window is minimized and there is no panic

## What actually happened

The actual result of the actions you described.

## Additional information

```
// main.rs
use bevy::prelude::*;

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.run();
}
```
```
# Cargo.toml
[package]
name = "bevy_examples"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = { git = "https://gitee.com/lcw_qaq/bevy", features = ["dynamic"] }
```

# panic info
thread 'main' panicked at 'No surface found for window.', C:\Users\LCW\\.cargo\git\checkouts\bevy-09c88e8028296690\4423a2f\crates\bevy_wgpu\src\renderer\wgpu_render_resource_context.rs:372:14
```
// panic function
fn configure_surface(&self, window: &Window) {
let surfaces = self.resources.window_surfaces.read();

let surface_configuration: wgpu::SurfaceConfiguration = window.wgpu_into();
let surface = surfaces
.get(&window.id())
.expect("No surface found for window.");
surface.configure(&self.device, &surface_configuration);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.