Window handling library in pure Rust
with_prevent_default(true)
.WindowEvent::Destroyed
not being delivered after destroying window.EventLoopExtRunOnDemand::run_on_demand
not working for consequent invocationFn
.refresh_rate_millihertz
.wl_subcompositor
is not supported.Xft.dpi
detection from Xresources.window.set_fullscreen(Some(Fullscreen::Borderless(None)))
resulting in losing previous window state when eventually exiting fullscreen using window.set_fullscreen(None)
.set_ime_cursor_area
.drag_window
and drag_resize_window
can be called from another thread.set_control_flow
in AboutToWait
not being taken in account.Resized
event after each ScaleFactorChanged
event.wl_surface
being destroyed before associated objects.Fn
key.PhysicalSize
passed in WindowBuilder::with_inner_size
when possible.RedrawRequsted
being always sent without decorations and sctk-adwaita
feature.configure_bounds
to constrain with_inner_size
when compositor wants users to pick size.Cursor{Enter,Leave}
.Window::set_transparent
.Window::set_blur
.1.60
to 1.65
.Event::MemoryWarning
; implemented on iOS/Android.ndk
version to 0.8.0
, ndk-sys to 0.5.0
, android-activity
to 0.5.0
.ControlFlow
from Poll
to Wait
.Event::RedrawRequested
to WindowEvent::RedrawRequested
.ControlFlow::Exit
to EventLoopWindowTarget::exit()
and EventLoopWindowTarget::exiting()
and removed ControlFlow::ExitWithCode(_)
entirely.ControlFlow
to EventLoopWindowTarget::set_control_flow()
and EventLoopWindowTarget::control_flow()
.EventLoop::new
and EventLoopBuilder::build
now return Result<Self, EventLoopError>
WINIT_UNIX_BACKEND
was removed in favor of standard WAYLAND_DISPLAY
and DISPLAY
variables.DeviceEvent::Text
.Event
and WindowEvent
.Window::set_inner_size
to Window::request_inner_size
and indicate if the size was applied immediately.ActivationTokenDone
event which could be requested with the new startup_notify
module, see its docs for more.ScaleFactorChanged
now contains a writer instead of a reference to update inner size.run() -> !
has been replaced by run() -> Result<(), EventLoopError>
for returning errors without calling std::process::exit()
(#2767)EventLoopExtRunReturn
/ run_return
in favor of EventLoopExtPumpEvents
/ pump_events
and EventLoopExtRunOnDemand
/ run_on_demand
(#2767)RedrawRequested
is no longer guaranteed to be emitted after MainEventsCleared
, it is now platform-specific when the event is emitted after being requested via redraw_request()
.
RedrawRequested
is now driven by WM_PAINT
messages which are requested via redraw_request()
LoopDestroyed
renamed to LoopExiting
(#2900)RedrawEventsCleared
removed (#2900)MainEventsCleared
removed (#2900)modifiers
fields.DeviceEventFilter
to DeviceEvents
reversing the behavior of variants.AboutToWait
event which is emitted when the event loop is about to block and wait for new events (#2900)EventLoopWindowTarget::set_device_event_filter
to listen_device_events
.Window::set_ime_position
to Window::set_ime_cursor_area
adding a way to set exclusive zone.with_x11_visual
now takes the visual ID instead of the bare pointer.MouseButton
now supports Back
and Forward
variants, emitted from mouse events on Wayland, X11, Windows, macOS and Web.instant
is now replaced by web_time
.WindowEvent::Resized
.bitflags
crate version to 2
, which changes the API on exposed types.CursorIcon::Arrow
was removed.CursorIcon::Hand
is now named CursorIcon::Pointer
.CursorIcon
is now used from the cursor-icon
crate.WindowExtWebSys::canvas()
now returns an Option
.KeyboardInput
with KeyEvent
and RawKeyEvent
.
WindowEvent::KeyboardInput
to contain a KeyEvent
.Event::Key
to contain a RawKeyEvent
.Event::ReceivedCharacter
. In its place, you should use
KeyEvent.text
in combination with WindowEvent::Ime
.VirtualKeyCode
with the Key
enum.ScanCode
with the KeyCode
enum.ModifiersState::LOGO
to SUPER
and ModifiersState::CTRL
to CONTROL
.PhysicalKey
wrapping KeyCode
and NativeKeyCode
.KeyCode
to refer to keys (roughly) by their physical location.NativeKeyCode
to represent raw KeyCode
s which Winit doesn't
understand.Key
to represent the keys after they've been interpreted by the
active (software) keyboard layout.NamedKey
to represent the categorized keys.NativeKey
to represent raw Key
s which Winit doesn't understand.KeyLocation
to tell apart Key
s which usually "mean" the same thing,
but can appear simultaneously in different spots on the same keyboard
layout.Window::reset_dead_keys
to enable application-controlled cancellation
of dead key sequences.KeyEventExtModifierSupplement
to expose additional (and less
portable) interpretations of a given key-press.PhysicalKeyExtScancode
, which lets you convert between scancodes and
PhysicalKey
.ModifiersChanged
now uses dedicated Modifiers
struct.raw-window-handle
trait implementations instead:
platform::windows::HINSTANCE
.WindowExtWindows::hinstance
.WindowExtWindows::hwnd
.WindowExtIOS::ui_window
.WindowExtIOS::ui_view_controller
.WindowExtIOS::ui_view
.WindowExtMacOS::ns_window
.WindowExtMacOS::ns_view
.EventLoopWindowTargetExtWayland::wayland_display
.WindowExtWayland::wayland_surface
.WindowExtWayland::wayland_display
.WindowExtX11::xlib_window
.WindowExtX11::xlib_display
.WindowExtX11::xlib_screen_id
.WindowExtX11::xcb_connection
.raw-window-handle
in window
module.ElementState::is_pressed
.Window::pre_present_notify
to notify winit before presenting to the windowing system.Window::set_blur
to request a blur behind the window; implemented on Wayland for now.Window::show_window_menu
to request a titlebar/system menu; implemented on Wayland/Windows for now.AsFd
/AsRawFd
for EventLoop<T>
on X11 and Wayland.PartialOrd
and Ord
for MouseButton
.PartialOrd
and Ord
on types in the dpi
module.WindowBuilder
Send + Sync
.MonitorHandle
and VideoMode
usable from other threads.EventLoopBuilderExtAndroid::handle_volume_keys
to indicate that the application will handle the volume keys manually.DeviceId
to contain device id's.ModifiersChanged
not being sent.Window::outer_size
now accounts for client side decorations.Window::drag_resize_window
method.WINIT_WAYLAND_CSD_THEME
variable.TouchPhase::Canceled
being sent for moved events.Occluded
event with xdg-shell v6RedrawRequested
events so redraws will align with compositor.ControlFlow::WaitUntil
now uses the Prioritized Task Scheduling API. setTimeout()
, with a trick to circumvent throttling to 4ms, is used as a fallback.EventLoopProxy
now implements Send
.Window
now implements Send
and Sync
.padding
, border
, and margin
when getting or setting the canvas position.DeviceEvent::Motion
, DeviceEvent::MouseWheel
, DeviceEvent::Button
and DeviceEvent::Key
support.EventLoopWindowTargetExtWebSys
and PollStrategy
, which allows to set different strategies for ControlFlow::Poll
. By default the Prioritized Task Scheduling API is used, but an option to use Window.requestIdleCallback
is available as well. Both use setTimeout()
, with a trick to circumvent throttling to 4ms, as a fallback.WindowBuilderExtWebSys::with_append()
to append the canvas element to the web page on creation.spawn
.ControlFlow::WaitUntil
to never wake up before the given time.DeviceEvent::MouseMotion
only being emitted for each canvas instead of the whole window.Window:::set_fullscreen
doing nothing when called outside the event loop but during transient activation.WindowBuilder
methods doing nothing.Window
methods using incorrect HTML attributes instead of CSS properties.beforeunload
event and map bfcache loading/unloading to Suspended
/Resumed
events.Window::focus_window()
.Window::set_(min|max)_inner_size()
.WindowEvent::Occluded
.MonitorHandle
.Window::is_dark_mode()
, which was replaced with Window::theme()
.EventLoopWindowTarget::listen_device_events()
settings.Window.requestAnimationFrame()
to throttle RedrawRequested
events.Window::request_redraw
not waking the event loop when called from outside the loop.drag_resize_window
method support.DeviceEvent
.WindowBuilderExtWindows::with_class_name
to customize the internal class name.CursorEnter/Left
not being sent when grabbing the mouse.RedrawRequested
not being delivered when calling Window::request_redraw
from RedrawRequested
.windows-sys
version 0.48.0.with_embedded_parent_window
function to the window builder to allow embedding a window into another window.ControlFlow::Poll
and ControlFlow::WaitUntil
.visual_id
in returned raw-window-handle
.ControlFlow::Poll
to ControlFlow::Poll
.WindowEvent::Occluded(false)
, WindowEvent::Occluded(true)
when application enters/leaves foreground.WindowExtMacOS
and EventLoopWindowTargetExtMacOS
.Globe
key.window.set_minimized(false)
.Window
.ndk
version to 0.8.0-beta.0
, ndk-sys to v0.5.0-beta.0
, android-activity
to 0.5.0-beta.1
.1.64
to 1.65
.raw-window-handle
in window
module.WINIT_UNIX_BACKEND
was removed in favor of standard WAYLAND_DISPLAY
and DISPLAY
variables.EventLoop::new
and EventLoopBuilder::build
now return Result<Self, EventLoopError>
visual_id
in returned raw-window-handle
.raw-window-handle
trait implementations instead:
platform::windows::HINSTANCE
.WindowExtWindows::hinstance
.WindowExtWindows::hwnd
.WindowExtIOS::ui_window
.WindowExtIOS::ui_view_controller
.WindowExtIOS::ui_view
.WindowExtMacOS::ns_window
.WindowExtMacOS::ns_view
.EventLoopWindowTargetExtWayland::wayland_display
.WindowExtWayland::wayland_surface
.WindowExtWayland::wayland_display
.WindowExtX11::xlib_window
.WindowExtX11::xlib_display
.WindowExtX11::xlib_screen_id
.WindowExtX11::xcb_connection
.Window.requestAnimationFrame()
to throttle RedrawRequested
events.RedrawRequested
events so redraws will align with compositor.Window::pre_present_notify
to notify winit before presenting to the windowing system.WindowBuilderExtWindows::with_class_name
to customize the internal class name.Event
and WindowEvent
.ScaleFactorChanged
now contains a writer instead of a reference to update inner size.ControlFlow::Poll
to ControlFlow::Poll
.ActivationTokenDone
event which could be requested with the new startup_notify
module, see its docs for more.WindowExtMacOS
and EventLoopWindowTargetExtMacOS
.Window::set_inner_size
to Window::request_inner_size
and indicate if the size was applied immediately.PartialOrd
and Ord
for Key
, KeyCode
, NativeKey
, and NativeKeyCode
.ElementState::is_pressed
.WindowEvent::Occluded
.padding
, border
, and margin
when getting or setting the canvas position.Window::set_(min|max)_inner_size()
.Window
methods using incorrect HTML attributes instead of CSS properties.WindowBuilder
methods doing nothing.Window::focus_window()
.Window::is_dark_mode()
, which was replaced with Window::theme()
.WindowBuilderExtWebSys::with_append()
to append the canvas element to the web page on creation.drag_resize_window
method support.run() ->!
has been replaced by run() -> Result<(), EventLoopError>
for returning errors without calling std::process::exit()
(#2767)EventLoopExtRunReturn
/ run_return
in favor of EventLoopExtPumpEvents
/ pump_events
and EventLoopExtRunOnDemand
/ run_ondemand
(#2767)RedrawRequested
is no longer guaranteed to be emitted after MainEventsCleared
, it is now platform-specific when the event is emitted after being requested via redraw_request()
.
RedrawRequested
is now driven by WM_PAINT
messages which are requested via redraw_request()
LoopDestroyed
renamed to LoopExiting
(#2900)RedrawEventsCleared
removed (#2900)MainEventsCleared
removed (#2900)AboutToWait
event which is emitted when the event loop is about to block and wait for new events (#2900)with_x11_visual
now takes the visual ID instead of the bare pointer.with_embedded_parent_window
function to the window builder to allow embedding a window into another window.spawn
.Window::set_ime_position
to Window::set_ime_cursor_area
adding a way to set exclusive zone.EventLoopBuilderExtAndroid::handle_volume_keys
to indicate that the application will handle the volume keys manually.DeviceEventFilter
to DeviceEvents
reversing the behavior of variants.EventLoopWindowTarget::set_device_event_filter
to listen_device_events
.EventLoopWindowTarget::listen_device_events
effect being reversed.modifiers
fields.KeyboardInput
with KeyEvent
and RawKeyEvent
.
WindowEvent::KeyboardInput
to contain a KeyEvent
.Event::Key
to contain a RawKeyEvent
.Event::ReceivedCharacter
. In its place, you should use
KeyEvent.text
in combination with WindowEvent::Ime
.VirtualKeyCode
with the Key
enum.ScanCode
with the KeyCode
enum.ModifiersState::LOGO
to SUPER
and ModifiersState::CTRL
to CONTROL
.KeyCode
to refer to keys (roughly) by their physical location.NativeKeyCode
to represent raw KeyCode
s which Winit doesn't
understand.Key
to represent the keys after they've been interpreted by the
active (software) keyboard layout.NativeKey
to represent raw Key
s which Winit doesn't understand.KeyLocation
to tell apart Key
s which usually "mean" the same thing,
but can appear simultaneously in different spots on the same keyboard
layout.Window::reset_dead_keys
to enable application-controlled cancellation
of dead key sequences.KeyEventExtModifierSupplement
to expose additional (and less
portable) interpretations of a given key-press.KeyCodeExtScancode
, which lets you convert between raw keycodes and
KeyCode
.ModifiersChanged
now uses dedicated Modifiers
struct.ModifiersChanged
not being sent.CursorIcon
is now used from the cursor-icon
crate.CursorIcon::Hand
is now named CursorIcon::Pointer
.CursorIcon::Arrow
was removed.Window::outer_size
now accounts for client side decorations.Window::drag_resize_window
method.WINIT_WAYLAND_CSD_THEME
variable.PartialOrd
and Ord
on types in the dpi
module.1.60
to 1.64
.Window::request_redraw
not waking the event loop when called from outside the loop.Window:::set_fullscreen
doing nothing when called outside the event loop but during
a transient activation.bitflags
crate version to 2
, which changes the API on exposed types.instant
is now replaced by web_time
.windows-sys
version 0.48.0.EventLoopProxy
now implements Send
.Window
now implements Send
and Sync
.WindowExtWebSys::canvas()
now returns an Option
.beforeunload
event and map bfcache loading/unloading to Suspended
/Resumed
events.Window
.Window.requestIdleCallback()
for ControlFlow::Poll
when available.WindowEvent::Resized
.EventLoopWindowTarget::listen_device_events()
settings.DeviceEvent::MouseMotion
only being emitted for each canvas instead of the whole window.DeviceEvent::Motion
, DeviceEvent::MouseWheel
, DeviceEvent::Button
and
DeviceEvent::Key
support.MouseButton
now supports Back
and Forward
variants, emitted from mouse events
on Wayland, X11, Windows, macOS and Web.Backspace
being emitted when clearing preedit with it.key_up
being ignored when Ime
is disabled.