Take Winit's `WindowEvent::Occluded` into account
- 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?
Currently Bevy will continue drawing even if the window isn't visible.
## What solution would you like?
Use Winit's [`WindowEvent::Occluded`](https://docs.rs/winit/0.29.9/winit/event/enum.WindowEvent.html#variant.Occluded) event to track if a window is occluded or not, in which case stop drawing.
There should also be an option to disable that behavior, as e.g. some platforms offer previews of the window, which some applications may want to keep up-to-date.
## What alternative(s) have you considered?
I'm not familiar enough with Bevy to know if users have further control of when to draw and when not to. If this is the case users could already do that themselves, as `WindowEvent::Occluded` is exposed as an event.
## Additional context
Winit has offered this event since v0.27, but it was only implemented for X11 and MacOS. With v0.29 it still is not implemented for Windows, but at least for all other platforms.
Contributor guide
Assessment
This issue has not been assessed yet.