Skip to content

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

@alice-i-cecile

Description

@alice-i-cecile

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsA-WindowingPlatform-agnostic interface layer to run your app inC-FeatureA new feature, making something new possibleS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions