Releases: rust-windowing/winit
Releases · rust-windowing/winit
Winit Version v0.28.1
- On Wayland, fix crash when dropping a window in multi-window setup.
Winit Version v0.28.0
- On macOS, fixed
Ime::Commit
persisting for all input after interacting withIme
. - On macOS, added
WindowExtMacOS::option_as_alt
andWindowExtMacOS::set_option_as_alt
. - On Windows, fix window size for maximized, undecorated windows.
- On Windows and macOS, add
WindowBuilder::with_active
. - Add
Window::is_minimized
. - On X11, fix errors handled during
register_xlib_error_hook
invocation bleeding into winit. - Add
Window::has_focus
. - On Windows, fix
Window::set_minimized(false)
not working for windows minimized byWin + D
hotkey. - Breaking: On Web, touch input no longer fires
WindowEvent::Cursor*
,WindowEvent::MouseInput
, orDeviceEvent::MouseMotion
like other platforms, but instead it firesWindowEvent::Touch
. - Breaking: Removed platform specific
WindowBuilder::with_parent
API in favor ofWindowBuilder::with_parent_window
. - On Windows, retain
WS_MAXIMIZE
window style when un-minimizing a maximized window. - On Windows, fix left mouse button release event not being sent after
Window::drag_window
. - On macOS, run most actions on the main thread, which is strictly more correct, but might make multithreaded applications block slightly more.
- On macOS, fix panic when getting current monitor without any monitor attached.
- On Windows and MacOS, add API to enable/disable window buttons (close, minimize, ...etc).
- On Windows, macOS, X11 and Wayland, add
Window::set_theme
. - Breaking: Remove
WindowExtWayland::wayland_set_csd_theme
andWindowBuilderExtX11::with_gtk_theme_variant
. - On Windows, revert window background to an empty brush to avoid white flashes when changing scaling.
- Breaking: Removed
Window::set_always_on_top
and related APIs in favor ofWindow::set_window_level
. - On Windows, MacOS and X11, add always on bottom APIs.
- On Windows, fix the value in
MouseButton::Other
. - On macOS, add
WindowExtMacOS::is_document_edited
andWindowExtMacOS::set_document_edited
APIs. - Breaking: Removed
WindowBuilderExtIOS::with_root_view_class
; instead, you should use[[view layer] addSublayer: ...]
to add an instance of the desired layer class (e.g.CAEAGLLayer
orCAMetalLayer
). Seevulkano-win
orwgpu
for examples of this. - On MacOS and Windows, add
Window::set_content_protected
. - On MacOS, add
EventLoopBuilderExtMacOS::with_activate_ignoring_other_apps
. - On Windows, fix icons specified on
WindowBuilder
not taking effect for windows created after the first one. - On Windows and macOS, add
Window::title
to query the current window title. - On Windows, fix focusing menubar when pressing
Alt
. - On MacOS, made
accepts_first_mouse
configurable. - Migrated
WindowBuilderExtUnix::with_resize_increments
toWindowBuilder
. - Added
Window::resize_increments
/Window::set_resize_increments
to update resize increments at runtime for X11/macOS. - macOS/iOS: Use
objc2
instead ofobjc
internally. - Breaking: Bump MSRV from
1.57
to1.60
. - Breaking: Split the
platform::unix
module intoplatform::x11
andplatform::wayland
. The extension types are similarly renamed. - Breaking:: Removed deprecated method
platform::unix::WindowExtUnix::is_ready
. - Removed
parking_lot
dependency. - Breaking: On macOS, add support for two-finger touchpad magnification and rotation gestures with new events
WindowEvent::TouchpadMagnify
andWindowEvent::TouchpadRotate
. Also add support for touchpad smart-magnification gesture with a new eventWindowEvent::SmartMagnify
. - Breaking: On web, the
WindowBuilderExtWebSys::with_prevent_default
setting (enabled by default), now additionally prevents scrolling of the webpage in mobile browsers, previously it only disabled scrolling on desktop. - On Wayland,
wayland-csd-adwaita
now usesab_glyph
instead ofcrossfont
to render the title for decorations. - On Wayland, a new
wayland-csd-adwaita-crossfont
feature was added to usecrossfont
instead ofab_glyph
for decorations. - On Wayland, if not otherwise specified use upstream automatic CSD theme selection.
- On X11, added
WindowExtX11::with_parent
to create child windows. - Added support for
WindowBuilder::with_theme
andWindow::theme
to support per-window dark/light/system theme configuration on macos, windows and wayland. - On macOS, added support for
WindowEvent::ThemeChanged
. - Breaking: Removed
WindowBuilderExtWindows::with_theme
andWindowBuilderExtWayland::with_wayland_csd_theme
in favour ofWindowBuilder::with_theme
. - Breaking: Removed
WindowExtWindows::theme
in favour ofWindow::theme
. - Enabled
doc_auto_cfg
when generating docs on docs.rs for feature labels. - Breaking: On Android, switched to using
android-activity
crate as a glue layer instead ofndk-glue
. See README.md#Android for more details. (#2444) - Breaking: Removed support for
raw-window-handle
version0.4
- On Wayland,
RedrawRequested
not emitted during resize. - Add a
set_wait_timeout
function toControlFlow
to allow waiting for aDuration
. - Breaking: Remove the unstable
xlib_xconnection()
function from the private interface. - Added Orbital support for Redox OS
- On X11, added
drag_resize_window
method. - Added
Window::set_transparent
to provide a hint about transparency of the window on Wayland and macOS. - On macOS, fix the mouse buttons other than left/right/middle being reported as middle.
- On Wayland, support fractional scaling via the wp-fractional-scale protocol.
- On web, fix removal of mouse event listeners from the global object upon window distruction.
- Add WindowAttributes getter to WindowBuilder to allow introspection of default values.
- Added
Window::set_ime_purpose
for setting the IME purpose, currently implemented on Wayland only.
Winit Version v0.27.5
- On Wayland, fix byte offset in
Ime::Preedit
pointing to invalid bytes.
Winit Version v0.27.4
- On Windows, emit
ReceivedCharacter
events on system keybindings. - On Windows, fixed focus event emission on minimize.
- On X11, fixed IME crashing during reload.
Winit Version v0.27.3
- On Windows, added
WindowExtWindows::set_undecorated_shadow
andWindowBuilderExtWindows::with_undecorated_shadow
to draw the drop shadow behind a borderless window. - On Windows, fixed default window features (ie snap, animations, shake, etc.) when decorations are disabled.
- On Windows, fixed ALT+Space shortcut to open window menu.
- On Wayland, fixed
Ime::Preedit
not being sent on IME reset. - Fixed unbound version specified for
raw-window-handle
leading to compilation failures. - Empty
Ime::Preedit
event will be sent beforeIme::Commit
to help clearing preedit. - On X11, fixed IME context picking by querying for supported styles beforehand.
Winit Version v0.27.2
- On macOS, fixed touch phase reporting when scrolling.
- On X11, fix min, max and resize increment hints not persisting for resizable windows (e.g. on DPI change).
- On Windows, respect min/max inner sizes when creating the window.
- For backwards compatibility,
Window
now (additionally) implements the old version (0.4
) of theHasRawWindowHandle
trait - On Windows, added support for
EventLoopWindowTarget::set_device_event_filter
. - On Wayland, fix user requested
WindowEvent::RedrawRequested
being delayed by a frame.
Winit Version v0.27.1
- The minimum supported Rust version was lowered to
1.57.0
and now explicitly tested. - On X11, fix crash on start due to inability to create an IME context without any preedit.
Winit Version v0.27.0
- On Windows, fix hiding a maximized window.
- On Android,
ndk-glue
'sNativeWindow
lock is now held betweenEvent::Resumed
andEvent::Suspended
. - On Web, added
EventLoopExtWebSys
with aspawn
method to start the event loop without throwing an exception. - Added
WindowEvent::Occluded(bool)
, currently implemented on macOS and X11. - On X11, fix events for caps lock key not being sent
- Build docs on
docs.rs
for iOS and Android as well. - Breaking: Removed the
WindowAttributes
struct, since all its functionality is accessible fromWindowBuilder
. - Added
WindowBuilder::transparent
getter to check if the user settransparent
attribute. - On macOS, Fix emitting
Event::LoopDestroyed
on CMD+Q. - On macOS, fixed an issue where having multiple windows would prevent run_return from ever returning.
- On Wayland, fix bug where the cursor wouldn't hide in GNOME.
- On macOS, Windows, and Wayland, add
set_cursor_hittest
to let the window ignore mouse events. - On Windows, added
WindowExtWindows::set_skip_taskbar
andWindowBuilderExtWindows::with_skip_taskbar
. - On Windows, added
EventLoopBuilderExtWindows::with_msg_hook
. - On Windows, remove internally unique DC per window.
- On macOS, remove the need to call
set_ime_position
after moving the window. - Added
Window::is_visible
. - Added
Window::is_resizable
. - Added
Window::is_decorated
. - On X11, fix for repeated event loop iteration when
ControlFlow
wasWait
- On X11, fix scale factor calculation when the only monitor is reconnected
- On Wayland, report unaccelerated mouse deltas in
DeviceEvent::MouseMotion
. - On Web, a focused event is manually generated when a click occurs to emulate behaviour of other backends.
- Breaking: Bump
ndk
version to 0.6, ndk-sys tov0.3
,ndk-glue
to0.6
. - Remove no longer needed
WINIT_LINK_COLORSYNC
environment variable. - Breaking: Rename the
Exit
variant ofControlFlow
toExitWithCode
, which holds a value to control the exit code after running. Add anExit
constant which aliases toExitWithCode(0)
instead to avoid major breakage. This shouldn't affect most existing programs. - Add
EventLoopBuilder
, which allows you to create and tweak the settings of an event loop before creating it. - Deprecated
EventLoop::with_user_event
; useEventLoopBuilder::with_user_event
instead. - Breaking: Replaced
EventLoopExtMacOS
withEventLoopBuilderExtMacOS
(which also has renamed methods). - Breaking: Replaced
EventLoopExtWindows
withEventLoopBuilderExtWindows
(which also has renamed methods). - Breaking: Replaced
EventLoopExtUnix
withEventLoopBuilderExtUnix
(which also has renamed methods). - Breaking: The platform specific extensions for Windows
winit::platform::windows
have changed. AllHANDLE
-like types e.g.HWND
andHMENU
were converted from winapi types or*mut c_void
toisize
. This was done to be consistent with the type definitions in windows-sys and to not expose internal dependencies. - The internal bindings to the Windows API were changed from the unofficial winapi bindings to the official Microsoft windows-sys bindings.
- On Wayland, fix polling during consecutive
EventLoop::run_return
invocations. - On Windows, fix race issue creating fullscreen windows with
WindowBuilder::with_fullscreen
- On Android,
virtual_keycode
forKeyboardInput
events is now filled in where a suitable match is found. - Added helper methods on
ControlFlow
to set its value. - On Wayland, fix
TouchPhase::Ended
always reporting the location of the first touch down, unless the compositor
sent a cancel or frame event. - On iOS, send
RedrawEventsCleared
even if there are no redraw events, consistent with other platforms. - Breaking: Replaced
Window::with_app_id
andWindow::with_class
withWindow::with_name
onWindowBuilderExtUnix
. - On Wayland, fallback CSD was replaced with proper one:
WindowBuilderExtUnix::with_wayland_csd_theme
to set color theme in builder.WindowExtUnix::wayland_set_csd_theme
to set color theme when creating a window.WINIT_WAYLAND_CSD_THEME
env variable was added, it can be used to set "dark"/"light" theme in apps that don't expose theme setting.wayland-csd-adwaita
feature that enables proper CSD with title rendering using FreeType system library.wayland-csd-adwaita-notitle
feature that enables CSD but without title rendering.
- On Wayland and X11, fix window not resizing with
Window::set_inner_size
after callingWindow:set_resizable(false)
. - On Windows, fix wrong fullscreen monitors being recognized when handling WM_WINDOWPOSCHANGING messages
- Breaking: Added new
WindowEvent::Ime
supported on desktop platforms. - Added
Window::set_ime_allowed
supported on desktop platforms. - Breaking: IME input on desktop platforms won't be received unless it's explicitly allowed via
Window::set_ime_allowed
and newWindowEvent::Ime
events are handled. - On macOS,
WindowEvent::Resized
is now emitted inframeDidChange
instead ofwindowDidResize
. - Breaking: On X11, device events are now ignored for unfocused windows by default, use
EventLoopWindowTarget::set_device_event_filter
to set the filter level. - Implemented
Default
onEventLoop<()>
. - Implemented
Eq
forFullscreen
,Theme
, andUserAttentionType
. - Breaking:
Window::set_cursor_grab
now acceptsCursorGrabMode
to control grabbing behavior. - On Wayland, add support for
Window::set_cursor_position
. - Fix on macOS
WindowBuilder::with_disallow_hidpi
, setting true or false by the user no matter the SO default value. EventLoopBuilder::build
will now panic when theEventLoop
is being created more than once.- Added
From<u64>
forWindowId
andFrom<WindowId>
foru64
. - Added
MonitorHandle::refresh_rate_millihertz
to get monitor's refresh rate. - Breaking, Replaced
VideoMode::refresh_rate
withVideoMode::refresh_rate_millihertz
providing better precision. - On Web, add
with_prevent_default
andwith_focusable
toWindowBuilderExtWebSys
to control whether events should be propagated. - On Windows, fix focus events being sent to inactive windows.
- Breaking, update
raw-window-handle
tov0.5
and implementHasRawDisplayHandle
forWindow
andEventLoopWindowTarget
. - On X11, add function
register_xlib_error_hook
intowinit::platform::unix
to subscribe for errors comming from Xlib. - On Android, upgrade
ndk
andndk-glue
dependencies to the recently released0.7.0
. - All platforms can now be relied on to emit a
Resumed
event. Applications are recommended to lazily initialize graphics state and windows on first resume for portability. - Breaking:: Reverse horizontal scrolling sign in
MouseScrollDelta
to match the direction of vertical scrolling. A positive X value now means moving the content to the right. The meaning of vertical scrolling stays the same: a positive Y value means moving the content down.
v0.26.1
- Fix linking to the
ColorSync
framework on macOS 10.7, and in newer Rust versions. - On Web, implement cursor grabbing through the pointer lock API.
- On X11, add mappings for numpad comma, numpad enter, numlock and pause.
- On macOS, fix Pinyin IME input by reverting a change that intended to improve IME.
- On Windows, fix a crash with transparent windows on Windows 11.
v0.26.0
- Update
raw-window-handle
tov0.4
. This is not a breaking change, we still implementHasRawWindowHandle
fromv0.3
, see rust-windowing/raw-window-handle#74. Note that you might have to runcargo update -p raw-window-handle
after upgrading. - On X11, bump
mio
to 0.8. - On Android, fixed
WindowExtAndroid::config
initially returning an emptyConfiguration
. - On Android, fixed
Window::scale_factor
andMonitorHandle::scale_factor
initially always returning 1.0. - On X11, select an appropriate visual for transparency if is requested
- On Wayland and X11, fix diagonal window resize cursor orientation.
- On macOS, drop the event callback before exiting.
- On Android, implement
Window::request_redraw
- Breaking: On Web, remove the
stdweb
backend. - Added
Window::focus_window
to bring the window to the front and set input focus. - On Wayland and X11, implement
is_maximized
method onWindow
. - On Windows, prevent ghost window from showing up in the taskbar after either several hours of use or restarting
explorer.exe
. - On macOS, fix issue where
ReceivedCharacter
was not being emitted during some key repeat events. - On Wayland, load cursor icons
hand2
andhand1
forCursorIcon::Hand
. - Breaking: On Wayland, Theme trait and its support types are dropped.
- On Wayland, bump
smithay-client-toolkit
to 0.15.1. - On Wayland, implement
request_user_attention
withxdg_activation_v1
. - On X11, emit missing
WindowEvent::ScaleFactorChanged
when the only monitor gets reconnected. - On X11, if RANDR based scale factor is higher than 20 reset it to 1
- On Wayland, add an enabled-by-default feature called
wayland-dlopen
so users can opt out of usingdlopen
to load system libraries. - Breaking: On Android, bump
ndk
andndk-glue
to 0.5. - On Windows, increase wait timer resolution for more accurate timing when using
WaitUntil
. - On macOS, fix native file dialogs hanging the event loop.
- On Wayland, implement a workaround for wrong configure size when using
xdg_decoration
inkwin_wayland
- On macOS, fix an issue that prevented the menu bar from showing in borderless fullscreen mode.
- On X11, EINTR while polling for events no longer causes a panic. Instead it will be treated as a spurious wakeup.