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

WinitSettings::desktop_app() is broken #11320

Closed
alice-i-cecile opened this issue Jan 13, 2024 · 2 comments · Fixed by #11325
Closed

WinitSettings::desktop_app() is broken #11320

alice-i-cecile opened this issue Jan 13, 2024 · 2 comments · Fixed by #11325
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Milestone

Comments

@alice-i-cecile
Copy link
Member

Bevy version

e6a324a

[Optional] Relevant system information

Windows

What you did

cargo run --example ui

What went wrong

The screen was black, and the example did not run.

Logs:

     Running `target\debug\examples\ui.exe`
2024-01-13T02:42:08.082255Z  INFO bevy_winit::system: Creating new window "App" (0v1)
2024-01-13T02:42:12.240658Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8726, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "537.34", backend: Vulkan }
2024-01-13T02:42:12.658481Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "", core_count: "24", memory: "31.8 GiB" }
2024-01-13T02:43:13.620288Z  WARN bevy_ecs::world: error[B0003]: Could not despawn entity 0v1 because it doesn't exist in this World.
2024-01-13T02:43:13.620545Z  WARN bevy_ecs::world: error[B0003]: Could not despawn entity 0v1 because it doesn't exist in this World.
2024-01-13T02:43:13.620679Z  WARN bevy_ecs::world: error[B0003]: Could not despawn entity 0v1 because it doesn't exist in this World.
2024-01-13T02:43:13.620941Z  INFO bevy_window::system: No windows are open, exiting
2024-01-13T02:43:13.621533Z  INFO bevy_winit::system: Closing window 0v1
2024-01-13T02:43:13.629905Z  WARN bevy_winit: Window 0v1 is missing `Window` component, skipping event ModifiersChanged(Modifiers { state: ModifiersState(0x0), pressed_mods: ModifiersKeys(0x0) })
2024-01-13T02:43:13.630288Z  WARN bevy_winit: Window 0v1 is missing `Window` component, skipping event Focused(false)
2024-01-13T02:43:13.633516Z  WARN bevy_winit: Window 0v1 is missing `Window` component, skipping event Destroyed

Additional information

First reported by Dj on Discord.

As suggested, removing the desktop_app setting fixed this: everything rendered correctly with no warnings.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Windowing Platform-agnostic interface layer to run your app in labels Jan 13, 2024
@alice-i-cecile alice-i-cecile added this to the 0.13 milestone Jan 13, 2024
@alice-i-cecile
Copy link
Member Author

Appears to be the same root cause as #11235.

@SolidStateDj
Copy link

SolidStateDj commented Jan 13, 2024

Ran this on my Linux machine originally. Compiled, no errors, but no window spawns.

However, during the writing of this comment, I left the program running in the background, and it did EVENTUALLY open. I tested this to take around 61s +/- 1s across 3 attempts to spawn the window compared to nearly instant when .insert_resource(WinitSettings::desktop_app()) is removed.

Logs:

Finished dev [optimized + debuginfo] target(s) in 0.14s
     Running `target/debug/examples/ui`
2024-01-13T03:12:16.727009Z  INFO bevy_winit::system: Creating new window "App" (0v0)
2024-01-13T03:12:16.931613Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3080 Ti", vendor: 4318, device: 8712, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "545.29.06", backend: Vulkan }
2024-01-13T03:12:17.169267Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux rolling Arch Linux", kernel: "6.6.10-arch1-1", cpu: "AMD Ryzen 9 5900X 12-Core Processor", core_count: "12", memory: "31.2 GiB" }}```

github-merge-queue bot pushed a commit that referenced this issue Jan 15, 2024
# Objective

- Partial fix for #11235 
- Fixes #11274 
- Fixes #11320 
- Fixes #11273

## Solution

- check update mode to trigger redraw request, instead of once a redraw
request has been triggered
- don't ignore device event in case of `Reactive` update mode
- make sure that at least 5 updates are triggered on application start
to ensure everything is correctly initialized
- trigger manual updates instead of relying on redraw requests when
there are no window or they are not visible
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants