A history of the changelog can be viewed by checking the Revisions tab above.
- 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 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.