A history of the changelog can be viewed by checking the Revisions
tab above.
- Change all occurrences of
EventsLoop
toEventLoop
. - Previously flat API is now exposed through
event
,event_loop
,monitor
, andwindow
modules. os
module changes:- Renamed to
platform
. - All traits now have platform-specific suffixes.
- Exposes new
desktop
module on Windows, Mac, and Linux.
- Renamed to
- Changes to event loop types:
EventLoopProxy::wakeup
has been removed in favor ofsend_event
.- Major: New
run
method drives winit event loop.- Returns
!
to ensure API behaves identically across all supported platforms.- This allows
emscripten
implementation to work without lying about the API.
- This allows
ControlFlow
's variants have been replaced withWait
,WaitUntil(Instant)
,Poll
, andExit
.- Is read after
EventsCleared
is processed. Wait
waits until new events are available.WaitUntil
waits until either new events are available or the provided time has been reached.Poll
instantly resumes the event loop.Exit
aborts 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 newWindow
s to be created.
- Returns
- Major:
platform::desktop
module exposesEventLoopExtDesktop
trait withrun_return
method.- Behaves identically to
run
, but returns control flow to the calling context can take non-'static
closures.
- Behaves identically to
EventLoop
'spoll_events
andrun_forever
methods have been removed in favor ofrun
andrun_return
.
- Changes to events:
- Remove
Event::Awakened
in favor ofEvent::UserEvent(T)
.- Can be sent with
EventLoopProxy::send_event
.
- Can be sent with
- Rename
WindowEvent::Refresh
toWindowEvent::RedrawRequested
.RedrawRequested
can be sent by the user with theWindow::request_redraw
method.
EventLoop
,EventLoopProxy
, andEvent
are now generic overT
, for use inUserEvent
.- Major: Add
NewEvents(StartCause)
,EventsCleared
, andLoopDestroyed
variants toEvent
.NewEvents
is emitted when new events are ready to be processed by event loop.StartCause
describes why new events are available, withResumeTimeReached
,Poll
,WaitCancelled
, andInit
(sent once at start of loop).
EventsCleared
is 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).
LoopDestroyed
is emitted when therun
orrun_return
method is about to exit.
- Remove
- Rename
MonitorId
toMonitorHandle
.