bevy/crates/bevy_winit/src
Mike cfcb56f5b9
Remove need for EventLoopProxy to be NonSend (#14198)
# Objective

- Continue to pare down the uses on NonSend resources in the engine. In
this case, EventLoopProxy used to be `!Sync`, but is now `Sync` in the
latest version of winit.

## Solution

- New type `EventLoopProxy` as `EventLoopProxyWrapper` to make it into a
normal resource.
- Update the `custom_user_event` example as it no longer needs to
indirectly access the `EventLoopProxy` through a static variable
anymore.

## Testing

- Ran the example. The resource exists just for users to use, so there
aren't any in engine uses for it currently.

---

## Changelog

- make EventLoopProxy into a regular resource. 

## Migration Guide

`EventLoopProxy` has been renamed to `EventLoopProxyWrapper` and is now
`Send`, making it an ordinary resource.

Before:
```rust
event_loop_system(event_loop: NonSend<EventLoopProxy<MyEvent>>) {
    event_loop.send_event(MyEvent);
}
```

After:
```rust
event_loop_system(event_loop: Res<EventLoopProxy<MyEvent>>) {
    event_loop.send_event(MyEvent);
}
```
2024-07-16 06:59:01 +00:00
..
accessibility.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
converters.rs Expose Winit's KeyEvent::repeat in KeyboardInput (#14161) 2024-07-15 14:52:33 +00:00
lib.rs Remove need for EventLoopProxy to be NonSend (#14198) 2024-07-16 06:59:01 +00:00
state.rs Remove need for EventLoopProxy to be NonSend (#14198) 2024-07-16 06:59:01 +00:00
system.rs apply window scale to window size when creating it (#13967) 2024-06-21 18:04:57 +00:00
winit_config.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
winit_event.rs flush key_input cache when Bevy loses focus (Adopted) (#13678) 2024-06-05 02:06:47 +00:00
winit_windows.rs Have WindowPosition::Centered take scale_factor_override into account (#13949) 2024-06-24 20:56:46 +00:00