|
1 | 1 | # Unreleased
|
| 2 | +- Changes below are considered **breaking**. |
| 3 | +- Change all occurrences of `EventsLoop` to `EventLoop`. |
| 4 | +- Previously flat API is now exposed through `event`, `event_loop`, `monitor`, and `window` modules. |
| 5 | +- `os` module changes: |
| 6 | + - Renamed to `platform`. |
| 7 | + - All traits now have platform-specific suffixes. |
| 8 | + - Exposes new `desktop` module on Windows, Mac, and Linux. |
| 9 | +- Changes to event loop types: |
| 10 | + - `EventLoopProxy::wakeup` has been removed in favor of `send_event`. |
| 11 | + - **Major:** New `run` method drives winit event loop. |
| 12 | + - Returns `!` to ensure API behaves identically across all supported platforms. |
| 13 | + - This allows `emscripten` implementation to work without lying about the API. |
| 14 | + - `ControlFlow`'s variants have been replaced with `Wait`, `WaitUntil(Instant)`, `Poll`, and `Exit`. |
| 15 | + - Is read after `EventsCleared` is processed. |
| 16 | + - `Wait` waits until new events are available. |
| 17 | + - `WaitUntil` waits until either new events are available or the provided time has been reached. |
| 18 | + - `Poll` instantly resumes the event loop. |
| 19 | + - `Exit` aborts the event loop. |
| 20 | + - Takes a closure that implements `'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow)`. |
| 21 | + - `&EventLoop<T>` is provided to allow new `Window`s to be created. |
| 22 | + - **Major:** `platform::desktop` module exposes `EventLoopExtDesktop` trait with `run_return` method. |
| 23 | + - Behaves identically to `run`, but returns control flow to the calling context can take non-`'static` closures. |
| 24 | + - `EventLoop`'s `poll_events` and `run_forever` methods have been removed in favor of `run` and `run_return`. |
| 25 | +- Changes to events: |
| 26 | + - Remove `Event::Awakened` in favor of `Event::UserEvent(T)`. |
| 27 | + - Can be sent with `EventLoopProxy::send_event`. |
| 28 | + - Rename `WindowEvent::Refresh` to `WindowEvent::RedrawRequested`. |
| 29 | + - `RedrawRequested` can be sent by the user with the `Window::request_redraw` method. |
| 30 | + - `EventLoop`, `EventLoopProxy`, and `Event` are now generic over `T`, for use in `UserEvent`. |
| 31 | + - **Major:** Add `NewEvents(StartCause)`, `EventsCleared`, and `LoopDestroyed` variants to `Event`. |
| 32 | + - `NewEvents` is emitted when new events are ready to be processed by event loop. |
| 33 | + - `StartCause` describes why new events are available, with `ResumeTimeReached`, `Poll`, `WaitCancelled`, and `Init` (sent once at start of loop). |
| 34 | + - `EventsCleared` is emitted when all available events have been processed. |
| 35 | + - Can be used to perform logic that depends on all events being processed (e.g. an iteration of a game loop). |
| 36 | + - `LoopDestroyed` is emitted when the `run` or `run_return` method is about to exit. |
| 37 | +- Rename `MonitorId` to `MonitorHandle`. |
2 | 38 |
|
3 | 39 | # Version 0.18.0 (2018-11-07)
|
4 | 40 |
|
|
0 commit comments