-
Change ActiveEventLoop and Window to be traits, and added cast_ref/cast_mut/cast
methods to extract the backend type from those.
-
ActiveEventLoop::create_window now returns Box<dyn Window>.
-
ApplicationHandler now uses dyn ActiveEventLoop.
-
On Web, let events wake up event loop immediately when using ControlFlow::Poll.
-
Bump MSRV from 1.70 to 1.85.
-
Changed ApplicationHandler::user_event to user_wake_up, removing the
generic user event.
Winit will now only indicate that wake up happened, you will have to pair
this with an external mechanism like std::sync::mpsc::channel if you want
to send specific data to be processed on the main thread.
-
Changed EventLoopProxy::send_event to EventLoopProxy::wake_up, it now
only wakes up the loop.
-
On X11, implement smooth resizing through the sync extension API.
-
ApplicationHandler::can_create|destroy_surfaces() was split off from
ApplicationHandler::resumed/suspended().
ApplicationHandler::can_create_surfaces() should, for portability reasons
to Android, be the only place to create render surfaces.
ApplicationHandler::resumed/suspended() are now only emitted by iOS, Web
and Android, and now signify actually resuming/suspending the application.
-
Rename platform::web::*ExtWebSys to *ExtWeb.
-
Change signature of EventLoop::run_app, EventLoopExtPumpEvents::pump_app_events and
EventLoopExtRunOnDemand::run_app_on_demand to accept a impl ApplicationHandler directly,
instead of requiring a &mut reference to it.
-
On Web, Window::canvas() now returns a reference.
-
On Web, CursorGrabMode::Locked now lets DeviceEvent::MouseMotion return raw data, not OS
accelerated, if the browser supports it.
-
(Active)EventLoop::create_custom_cursor() now returns a Result<CustomCursor, ExternalError>.
-
Changed how ModifiersState is serialized by Serde.
-
VideoModeHandle::refresh_rate_millihertz() and bit_depth() now return a Option<NonZero*>.
-
MonitorHandle::position() now returns an Option.
-
On macOS, remove custom application delegates. You are now allowed to override the
application delegate yourself.
-
On X11, remove our dependency on libXcursor. (#3749)
-
Renamed the following APIs to make it clearer that the sizes apply to the underlying surface:
WindowEvent::Resized to SurfaceResized.
InnerSizeWriter to SurfaceSizeWriter.
WindowAttributes.inner_size to surface_size.
WindowAttributes.min_inner_size to min_surface_size.
WindowAttributes.max_inner_size to max_surface_size.
WindowAttributes.resize_increments to surface_resize_increments.
WindowAttributes::with_inner_size to with_surface_size.
WindowAttributes::with_min_inner_size to with_min_surface_size.
WindowAttributes::with_max_inner_size to with_max_surface_size.
WindowAttributes::with_resize_increments to with_surface_resize_increments.
Window::inner_size to surface_size.
Window::request_inner_size to request_surface_size.
Window::set_min_inner_size to set_min_surface_size.
Window::set_max_inner_size to set_max_surface_size.
To migrate, you can probably just replace all instances of inner_size with surface_size in your codebase.
-
Every event carrying a DeviceId now uses Option<DeviceId> instead. A None value signifies that the
device can't be uniquely identified.
-
Pointer WindowEvents were overhauled. The new events can handle any type of pointer, serving as
a single pointer input source. Now your application can handle any pointer type without having to
explicitly handle e.g. Touch:
- Rename
CursorMoved to PointerMoved.
- Rename
CursorEntered to PointerEntered.
- Rename
CursorLeft to PointerLeft.
- Rename
MouseInput to PointerButton.
- Add
primary to every PointerEvent as a way to identify discard non-primary pointers in a
multi-touch interaction.
- Add
position to every PointerEvent.
PointerMoved is not sent after PointerEntered anymore.
- Remove
Touch, which is folded into the Pointer* events.
- New
PointerKind added to PointerEntered and PointerLeft, signifying which pointer type is
the source of this event.
- New
PointerSource added to PointerMoved, similar to PointerKind but holding additional
data.
- New
ButtonSource added to PointerButton, similar to PointerKind but holding pointer type
specific buttons. Use ButtonSource::mouse_button() to easily normalize any pointer button
type to a generic mouse button.
- New
FingerId added to PointerKind::Touch and PointerSource::Touch able to uniquely
identify a finger in a multi-touch interaction. Replaces the old Touch::id.
- In the same spirit rename
DeviceEvent::MouseMotion to PointerMotion.
- Remove
Force::Calibrated::altitude_angle.
-
On X11, use bottom-right corner for IME hotspot in Window::set_ime_cursor_area.
-
On macOS and iOS, no longer emit ScaleFactorChanged upon window creation.
-
On macOS, no longer emit Focused upon window creation.
-
On iOS, emit more events immediately, instead of queuing them.
-
Update smol_str to version 0.3
-
Rename VideoModeHandle to VideoMode, now it only stores plain data.
-
Make Fullscreen::Exclusive contain (MonitorHandle, VideoMode).
-
Reworked the file drag-and-drop API.
-
On macOS, the default menu uses the bundle name or falls back to the process name as before.
The WindowEvent::DroppedFile, WindowEvent::HoveredFile and WindowEvent::HoveredFileCancelled
events have been removed, and replaced with WindowEvent::DragEntered, WindowEvent::DragMoved,
WindowEvent::DragDropped and WindowEvent::DragLeft.
The old drag-and-drop events were emitted once per file. This occurred when files were first
hovered over the window, dropped, or left the window. The new drag-and-drop events are emitted
once per set of files dragged, and include a list of all dragged files. They also include the
pointer position.
The rough correspondence is:
WindowEvent::HoveredFile -> WindowEvent::DragEntered
WindowEvent::DroppedFile -> WindowEvent::DragDropped
WindowEvent::HoveredFileCancelled -> WindowEvent::DragLeft
The WindowEvent::DragMoved event is entirely new, and is emitted whenever the pointer moves
whilst files are being dragged over the window. It doesn't contain any file paths, just the
pointer position.
-
Updated objc2 to v0.6.
-
Updated windows-sys to v0.59.
- To match the corresponding changes in
windows-sys, the HWND, HMONITOR, and HMENU types
now alias to *mut c_void instead of isize.
-
Removed KeyEventExtModifierSupplement, and made the fields text_with_all_modifiers and
key_without_modifiers public on KeyEvent instead.
-
Move window::Fullscreen to monitor::Fullscreen.
-
Renamed "super" key to "meta", to match the naming in the W3C specification.
NamedKey::Super still exists, but it's non-functional and deprecated, NamedKey::Meta should be used instead.
-
Move IconExtWindows into WinIcon.
-
Move EventLoopExtPumpEvents and PumpStatus from platform module to winit::event_loop::pump_events.
-
Move EventLoopExtRunOnDemand from platform module to winit::event_loop::run_on_demand.
-
Use NamedKey, Code and Location from the keyboard-types v0.8 crate.
-
Deprecate Window::set_ime_allowed, Window::set_ime_cursor_area, and Window::set_ime_purpose.
-
Force::normalized() now takes a Option<ToolAngle> to calculate the perpendicular force.
-
On Windows, don't confine cursor to center of window when grabbed and hidden.