bevy/examples/window
akimakinai bafffe1c5f
Fix screenshot example (#15094)
# Objective

I noticed some issues in `screenshot` example:
1. Cursor icon won't return from `SystemCursorIcon::Progress` to default
icon, even though screen shot saving is done.
2. Panics when exiting window: ``called `Result::unwrap()` on an `Err`
value:
NoEntities("bevy_ecs::query::state::QueryState<bevy_ecs::entity::Entity,
bevy_ecs::query::filter::With<bevy_window:🪟:Window>>")``

## Solution

1. Caused by cursor updating system not responding to [`CursorIcon`
component
removal](5cfcbf47ed/examples/window/screenshot.rs (L38)).
I believe it should, so change it to react to
`RemovedComponents<CursorIcon>`. (a suggestion)
2. Use `get_single` for window.

## Testing

- run screenshot example

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-09-09 16:53:20 +00:00
..
clear_color.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
custom_user_event.rs Remove need for EventLoopProxy to be NonSend (#14198) 2024-07-16 06:59:01 +00:00
low_power.rs Remove need for EventLoopProxy to be NonSend (#14198) 2024-07-16 06:59:01 +00:00
monitor_info.rs Expose winit's MonitorHandle (#13669) 2024-08-06 10:54:37 +00:00
multiple_windows.rs glTF labels: add enum to avoid misspelling and keep up-to-date list documented (#13586) 2024-05-31 23:25:57 +00:00
scale_factor_override.rs fix: upgrade to winit v0.30 (#13366) 2024-06-03 13:06:48 +00:00
screenshot.rs Fix screenshot example (#15094) 2024-09-09 16:53:20 +00:00
transparent_window.rs Remove redundant imports (#12817) 2024-04-01 19:59:08 +00:00
window_resizing.rs Made the naming for commands parameter more consistent (#14851) 2024-08-22 16:53:05 +00:00
window_settings.rs Add custom cursors (#14284) 2024-08-12 15:49:03 +00:00