bevy/examples/input
Jan Hohenheim a750cfe4a1
Split CursorOptions off of Window (#19668)
# Objective

- Fixes #19627 
- Tackles part of #19644 
- Supersedes #19629
- `Window` has become a very very very big component
- As such, our change detection does not *really* work on it, as e.g.
moving the mouse will cause a change for the entire window
- We circumvented this with a cache
- But, some things *shouldn't* be cached as they can be changed from
outside the user's control, notably the cursor grab mode on web
- So, we need to disable the cache for that
- But because change detection is broken, that would result in the
cursor grab mode being set every frame the mouse is moved
- That is usually *not* what a dev wants, as it forces the cursor to be
locked even when the end-user is trying to free the cursor on the
browser
  - the cache in this situation is invalid due to #8949

## Solution

- Split `Window` into multiple components, each with working change
detection
- Disable caching of the cursor grab mode
- This will only attempt to force the grab mode when the `CursorOptions`
were touched by the user, which is *much* rarer than simply moving the
mouse.
- If this PR is merged, I'll do the exact same for the other
constituents of `Window` as a follow-up

## Testing

- Ran all the changed examples
2025-06-17 20:20:13 +00:00
..
char_input_events.rs Fix inconsistency in KeyboardInput examples to match migration guide (#14185) 2024-07-15 15:03:48 +00:00
gamepad_input_events.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
gamepad_input.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
gamepad_rumble.rs Renamed EventWriter::send methods to write. (#17977) 2025-02-23 21:18:52 +00:00
keyboard_input_events.rs
keyboard_input.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
keyboard_modifiers.rs
mouse_grab.rs Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
mouse_input_events.rs
mouse_input.rs Mouse input accumulation (#14044) 2024-07-01 14:27:21 +00:00
text_input.rs Update text_input and virtual_time examples to use Improved Spawning API (#18249) 2025-03-11 05:47:56 +00:00
touch_input_events.rs
touch_input.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00