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

Minimizing window with 2d camera causes a crash #4526

Closed
opstic opened this issue Apr 18, 2022 · 1 comment
Closed

Minimizing window with 2d camera causes a crash #4526

opstic opened this issue Apr 18, 2022 · 1 comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@opstic
Copy link
Contributor

opstic commented Apr 18, 2022

Bevy version

Bevy v0.7.0 (crates.io) & v0.8.0-dev (b3e39d0)

Operating system & version

Windows 11 (Build 22000.613)

What you did

  1. New empty project
  2. Add DefaultPlugins and spawn a 2d OrthographicCameraBundle or a UiCameraBundle
  3. Run and minimize the window
  4. CRASH

What you expected to happen

App does not crash

What actually happened

App crashed with view entity should exist: QueryDoesNotMatch(0v0)

Additional information

Example code:

use bevy::prelude::*;
fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(setup)
        .run()
}

fn setup(mut commands: Commands) {
    commands.spawn_bundle(OrthographicCameraBundle::new_2d());
}

Full log:

2022-04-18T18:36:44.427341Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) UHD Graphics 620", vendor: 32902, device: 22807, device_type: IntegratedGpu, backend: Dx12 }
thread 'main' panicked at 'view entity should exist: QueryDoesNotMatch(0v0)', C:\Users\User\.cargo\git\checkouts\bevy-f7ffde730c324c74\06d709b\crates\bevy_core_pipeline\src\main_pass_2d.rs:45:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\crash.exe` (exit code: 101)
@opstic opstic added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 18, 2022
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in O-Windows Specific to the Windows desktop operating system P-Regression Functionality that used to work but no longer does. Add a test for this! and removed S-Needs-Triage This issue needs to be labelled labels Apr 18, 2022
DJMcNab added a commit to DJMcNab/bevy that referenced this issue Apr 18, 2022
@alice-i-cecile
Copy link
Member

This issue appears to be specific to 2D cameras; see the linked PR.

@opstic opstic changed the title Minimizing window causes a crash Minimizing window with 2d camera causes a crash Apr 19, 2022
DJMcNab added a commit to DJMcNab/bevy that referenced this issue Apr 26, 2022
@bors bors bot closed this as completed in 09a3d8a May 30, 2022
james7132 pushed a commit to james7132/bevy that referenced this issue Jun 7, 2022
# Objective

- We can't minimise if there's a 2d camera because ??? there legally must be a 2d target.
- Fixes bevyengine#4526
- Fixes bevyengine#4856

## Solution

- Make it not crash in those cases, just do nothing
- Seems to work ¯\\_(ツ)_/¯
- See also the companion commit in bevyengine#3597 - 503c247

Co-authored-by: Asteria <asteria131@outlook.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- We can't minimise if there's a 2d camera because ??? there legally must be a 2d target.
- Fixes bevyengine#4526
- Fixes bevyengine#4856

## Solution

- Make it not crash in those cases, just do nothing
- Seems to work ¯\\_(ツ)_/¯
- See also the companion commit in bevyengine#3597 - 503c247

Co-authored-by: Asteria <asteria131@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
2 participants