Repository navigation
v0.20.0-alpha1
Pre-release
Pre-release
·
1794 commits
to master
since this release
- Changes below are considered breaking.
- Change all occurrences of
EventsLooptoEventLoop. - Previously flat API is now exposed through
event,event_loop,monitor, andwindowmodules. osmodule changes:- Renamed to
platform. - All traits now have platform-specific suffixes.
- Exposes new
desktopmodule on Windows, Mac, and Linux.
- Renamed to
- Changes to event loop types:
EventLoopProxy::wakeuphas been removed in favor ofsend_event.- Major: New
runmethod drives winit event loop.- Returns
!to ensure API behaves identically across all supported platforms.- This allows
emscriptenimplementation to work without lying about the API.
- This allows
ControlFlow's variants have been replaced withWait,WaitUntil(Instant),Poll, andExit.- Is read after
EventsClearedis processed. Waitwaits until new events are available.WaitUntilwaits until either new events are available or the provided time has been reached.Pollinstantly resumes the event loop.Exitaborts the event loop.
- Is read after
- Takes a closure that implements
'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow).&EventLoop<T>is provided to allow newWindows to be created.
- Returns
- Major:
platform::desktopmodule exposesEventLoopExtDesktoptrait withrun_returnmethod.- Behaves identically to
run, but returns control flow to the calling context and can take non-'staticclosures.
- Behaves identically to
EventLoop'spoll_eventsandrun_forevermethods have been removed in favor ofrunandrun_return.
- Changes to events:
- Remove
Event::Awakenedin favor ofEvent::UserEvent(T).- Can be sent with
EventLoopProxy::send_event.
- Can be sent with
- Rename
WindowEvent::RefreshtoWindowEvent::RedrawRequested.RedrawRequestedcan be sent by the user with theWindow::request_redrawmethod.
EventLoop,EventLoopProxy, andEventare now generic overT, for use inUserEvent.- Major: Add
NewEvents(StartCause),EventsCleared, andLoopDestroyedvariants toEvent.NewEventsis emitted when new events are ready to be processed by event loop.StartCausedescribes why new events are available, withResumeTimeReached,Poll,WaitCancelled, andInit(sent once at start of loop).
EventsClearedis emitted when all available events have been processed.- Can be used to perform logic that depends on all events being processed (e.g. an iteration of a game loop).
LoopDestroyedis emitted when therunorrun_returnmethod is about to exit.
- Remove
- Rename
MonitorIdtoMonitorHandle. - Removed
serdeimplementations fromControlFlow. - Rename several functions to improve both internal consistency and compliance with Rust API guidelines.
- Remove
WindowBuilder::multitouchfield, since it was only implemented on a few platforms. Multitouch is always enabled now. - Breaking: On macOS, change
nsidentifiers to use snake_case for consistency with iOS'suiidentifiers. - Add
MonitorHandle::video_modesmethod for retrieving supported video modes for the given monitor. - On Wayland, the window now exists even if nothing has been drawn.
- On Windows, fix initial dimensions of a fullscreen window.
- On Windows, Fix transparent borderless windows rendering wrong.