bevyengine / bevyengine/bevy

`bevy_assets` should send wake events to `bevy_window` when assets finish loading (async tasks and `desktop_app` interactions)

Open
#20,873 3 comments 0 reactions 0 assignees View on GitHub
A-Assets A-Windowing C-Feature S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

When running in `desktop_app` mode, applications can get "stuck" in an unloaded or partially loaded state.

This leads to bugs like #20796.

## What solution would you like?

The `AssetServer` should send wake events whenever assets are finished loading, if we're running in a mode like `desktop_app`. That's pretty hand-wavey, so there's more digging to do before we can implement this.

This is quite hard to do though: the `App` code is fully paused without user inputs. Somehow, we need to be regularly and efficiently polling even when the app is asleep. Apparently `egui` / `bevy_egui` do a better job of this (thanks @aevyrie), so looking there for prior art would be wise.

## What alternative(s) have you considered?

Don't use `desktop_app`, as we did in #20851 as a workaround. This isn't viable in the long-term though: input-driven windowing provides better responsivity and power efficiency.

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.