bevy/tools
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
..
build-easefunction-graphs Add print_stdout and print_stderr lints (#17446) (#18233) 2025-03-11 19:35:48 +00:00
build-templated-pages Upgrade to Rust Edition 2024 (#17967) 2025-02-24 03:54:47 +00:00
build-wasm-example Add debug build option to build-wasm-example (#19312) 2025-05-24 01:43:57 +00:00
ci Allow passing number of thread for building and testing to CI (#19359) 2025-06-16 21:19:47 +00:00
compile_fail_utils bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
example-showcase Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
publish.sh don't wait during publishing (#18563) 2025-03-26 21:27:29 +00:00