bevy/tools/example-showcase
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
..
src More uninlined_format_args fixes (#19396) 2025-05-28 02:35:18 +00:00
asset-source-website.patch
Cargo.toml Bump ron version to 0.10. (#19631) 2025-06-13 19:54:31 +00:00
disable-audio.patch Remove tracing re-export from bevy_utils (#17161) 2025-01-05 23:06:34 +00:00
extra-window-resized-events.patch update CI patch for EventWriter::send deprecation (#18044) 2025-02-26 20:36:15 +00:00
fixed-window-position.patch Split CursorOptions off of Window (#19668) 2025-06-17 20:20:13 +00:00
reduce-light-cluster-config.patch
remove-desktop-app-mode.patch Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
window-settings-wasm.patch Remove Implicit std Prelude from no_std Crates (#17086) 2025-01-03 01:58:43 +00:00