Skip to content

Releases: rust-windowing/winit

Winit Version v0.27.0

26 Jul 20:57
v0.27.0
5003564
Compare
Choose a tag to compare
  • On Windows, fix hiding a maximized window.
  • On Android, ndk-glue's NativeWindow lock is now held between Event::Resumed and Event::Suspended.
  • On Web, added EventLoopExtWebSys with a spawn 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 from WindowBuilder.
  • Added WindowBuilder::transparent getter to check if the user set transparent 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 and WindowBuilderExtWindows::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 was Wait
  • 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 to v0.3, ndk-glue to 0.6.
  • Remove no longer needed WINIT_LINK_COLORSYNC environment variable.
  • Breaking: Rename the Exit variant of ControlFlow to ExitWithCode, which holds a value to control the exit code after running. Add an Exit constant which aliases to ExitWithCode(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; use EventLoopBuilder::with_user_event instead.
  • Breaking: Replaced EventLoopExtMacOS with EventLoopBuilderExtMacOS (which also has renamed methods).
  • Breaking: Replaced EventLoopExtWindows with EventLoopBuilderExtWindows (which also has renamed methods).
  • Breaking: Replaced EventLoopExtUnix with EventLoopBuilderExtUnix (which also has renamed methods).
  • Breaking: The platform specific extensions for Windows winit::platform::windows have changed. All HANDLE-like types e.g. HWND and HMENU were converted from winapi types or *mut c_void to isize. 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 for KeyboardInput 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 and Window::with_class with Window::with_name on WindowBuilderExtUnix.
  • 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 calling Window: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 new WindowEvent::Ime events are handled.
  • On macOS, WindowEvent::Resized is now emitted in frameDidChange instead of windowDidResize.
  • 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 on EventLoop<()>.
  • Implemented Eq for Fullscreen, Theme, and UserAttentionType.
  • Breaking: Window::set_cursor_grab now accepts CursorGrabMode 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 the EventLoop is being created more than once.
  • Added From<u64> for WindowId and From<WindowId> for u64.
  • Added MonitorHandle::refresh_rate_millihertz to get monitor's refresh rate.
  • Breaking, Replaced VideoMode::refresh_rate with VideoMode::refresh_rate_millihertz providing better precision.
  • On Web, add with_prevent_default and with_focusable to WindowBuilderExtWebSys to control whether events should be propagated.
  • On Windows, fix focus events being sent to inactive windows.
  • Breaking, update raw-window-handle to v0.5 and implement HasRawDisplayHandle for Window and EventLoopWindowTarget.
  • On X11, add function register_xlib_error_hook into winit::platform::unix to subscribe for errors comming from Xlib.
  • On Android, upgrade ndk and ndk-glue dependencies to the recently released 0.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

05 Jan 14:40
d3e6949
Compare
Choose a tag to compare
  • 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

01 Dec 11:54
ea1c031
Compare
Choose a tag to compare
  • Update raw-window-handle to v0.4. This is not a breaking change, we still implement HasRawWindowHandle from v0.3, see rust-windowing/raw-window-handle#74. Note that you might have to run cargo update -p raw-window-handle after upgrading.
  • On X11, bump mio to 0.8.
  • On Android, fixed WindowExtAndroid::config initially returning an empty Configuration.
  • On Android, fixed Window::scale_factor and MonitorHandle::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_windowto bring the window to the front and set input focus.
  • On Wayland and X11, implement is_maximized method on Window.
  • 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 and hand1 for CursorIcon::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 with xdg_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 using dlopen to load system libraries.
  • Breaking: On Android, bump ndk and ndk-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 in kwin_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.

v0.25.0

18 May 16:52
Compare
Choose a tag to compare
  • Breaking: On macOS, replace WindowBuilderExtMacOS::with_activation_policy with EventLoopExtMacOS::set_activation_policy
  • On macOS, wait with activating the application until the application has initialized.
  • On macOS, fix creating new windows when the application has a main menu.
  • On Windows, fix fractional deltas for mouse wheel device events.
  • On macOS, fix segmentation fault after dropping the main window.
  • On Android, InputEvent::KeyEvent is partially implemented providing the key scancode.
  • Added is_maximized method to Window.
  • On Windows, fix bug where clicking the decoration bar would make the cursor blink.
  • On Windows, fix bug causing newly created windows to erroneously display the "wait" (spinning) cursor.
  • On macOS, wake up the event loop immediately when a redraw is requested.
  • On Windows, change the default window size (1024x768) to match the default on other desktop platforms (800x600).
  • On Windows, fix bug causing mouse capture to not be released.
  • On Windows, fix fullscreen not preserving minimized/maximized state.
  • On Android, unimplemented events are marked as unhandled on the native event loop.
  • On Windows, added WindowBuilderExtWindows::with_menu to set a custom menu at window creation time.
  • On Android, bump ndk and ndk-glue to 0.3: use predefined constants for event ident.
  • On macOS, fix objects captured by the event loop closure not being dropped on panic.
  • On Windows, fixed WindowEvent::ThemeChanged not properly firing and fixed Window::theme returning the wrong theme.
  • On Web, added support for DeviceEvent::MouseMotion to listen for relative mouse movements.
  • Added WindowBuilder::with_position to allow setting the position of a Window on creation. Supported on Windows, macOS and X11.
  • Added Window::drag_window. Implemented on Windows, macOS, X11 and Wayland.
  • On X11, bump mio to 0.7.
  • On Windows, added WindowBuilderExtWindows::with_owner_window to allow creating popup windows.
  • On Windows, added WindowExtWindows::set_enable to allow creating modal popup windows.
  • On macOS, emit RedrawRequested events immediately while the window is being resized.
  • Implement Default, Hash, and Eq for LogicalPosition, PhysicalPosition, LogicalSize, and PhysicalSize.
  • On macOS, initialize the Menu Bar with minimal defaults. (Can be prevented using enable_default_menu_creation)
  • On macOS, change the default behavior for first click when the window was unfocused. Now the window becomes focused and then emits a MouseInput event on a "first mouse click".
  • Implement mint (math interoperability standard types) conversions (under feature flag mint).

v0.24.0

10 Dec 16:29
6db308f
Compare
Choose a tag to compare
  • On Windows, fix applications not exiting gracefully due to thread_event_target_callback accessing corrupted memory.
  • On Windows, implement Window::set_ime_position.
  • Breaking: On Windows, Renamed WindowBuilderExtWindows's is_dark_mode to theme.
  • On Windows, add WindowBuilderExtWindows::with_theme to set a preferred theme.
  • On Windows, fix bug causing message boxes to appear delayed.
  • On Android, calling WindowEvent::Focused now works properly instead of always returning false.
  • On Windows, fix alt-tab behaviour by removing borderless fullscreen "always on top" flag.
  • On Windows, fix bug preventing windows with transparency enabled from having fully-opaque regions.
  • Breaking: On Windows, include prefix byte in scancodes.
  • On Wayland, fix window not being resizeable when using with_min_inner_size in WindowBuilder.
  • On Unix, fix cross-compiling to wasm32 without enabling X11 or Wayland.
  • On Windows, fix use after free crash during window destruction.
  • On Web, fix WindowEvent::ReceivedCharacter never being sent on key input.
  • On macOS, fix compilation when targeting aarch64
  • On X11, fix Window::request_redraw not waking the event loop.
  • On Wayland, the keypad arrow keys are now recognized.
  • Breaking Rename desktop::EventLoopExtDesktop to run_return::EventLoopExtRunReturn.
  • Added request_user_attention method to Window.
  • Breaking: On macOS, removed WindowExt::request_user_attention, use Window::request_user_attention.
  • Breaking: On X11, removed WindowExt::set_urgent, use Window::request_user_attention.
  • On Wayland, default font size in CSD increased from 11 to 17.
  • On Windows, fix bug causing message boxes to appear delayed.
  • On Android, support multi-touch.
  • On Wayland, extra mouse buttons are not dropped anymore.
  • Breaking: MouseButton::Other now uses u16.

v0.23.0

02 Oct 15:11
d18afb4
Compare
Choose a tag to compare
  • On iOS, fixed support for the "Debug View Heirarchy" feature in Xcode.
  • On all platforms, available_monitors and primary_monitor are now on EventLoopWindowTarget rather than EventLoop to list monitors event in the event loop.
  • On Unix, X11 and Wayland are now optional features (enabled by default)
  • On X11, fix deadlock when calling set_fullscreen_inner.
  • On Web, prevent the webpage from scrolling when the user is focused on a winit canvas
  • On Web, calling window.set_cursor_icon no longer breaks HiDPI scaling
  • On Windows, drag and drop is now optional and must be enabled with WindowBuilderExtWindows::with_drag_and_drop(true).
  • On Wayland, fix deadlock when calling to set_inner_size from a callback.
  • On macOS, add hide__other_applications to EventLoopWindowTarget via existing EventLoopWindowTargetExtMacOS trait. hide_other_applications will hide other applications by calling -[NSApplication hideOtherApplications: nil].
  • On android added support for run_return.
  • On MacOS, Fixed fullscreen and dialog support for run_return.
  • On Windows, fix bug where we'd try to emit MainEventsCleared events during nested win32 event loops.
  • On Web, use mouse events if pointer events aren't supported. This affects Safari.
  • On Windows, set_ime_position is now a no-op instead of a runtime crash.
  • On Android, set_fullscreen is now a no-op instead of a runtime crash.
  • On iOS and Android, set_inner_size is now a no-op instead of a runtime crash.
  • On Android, fix ControlFlow::Poll not polling the Android event queue.
  • On macOS, add NSWindow.hasShadow support.
  • On Web, fix vertical mouse wheel scrolling being inverted.
  • On Web, implement mouse capturing for click-dragging out of the canvas.
  • On Web, fix ControlFlow::Exit not properly handled.
  • On Web (web-sys only), send WindowEvent::ScaleFactorChanged event when window.devicePixelRatio is changed.
  • Breaking: On Web, set_cursor_position and set_cursor_grab will now always return an error.
  • Breaking: PixelDelta scroll events now return a PhysicalPosition.
  • On NetBSD, fixed crash due to incorrect detection of the main thread.
  • Breaking: On X11, - key is mapped to the Minus virtual key code, instead of Subtract.
  • On macOS, fix inverted horizontal scroll.
  • Breaking: current_monitor now returns Option<MonitorHandle>.
  • Breaking: primary_monitor now returns Option<MonitorHandle>.
  • On macOS, updated core-* dependencies and cocoa.
  • Bump parking_lot to 0.11
  • On Android, bump ndk, ndk-sys and ndk-glue to 0.2. Checkout the new ndk-glue main proc attribute.
  • On iOS, fixed starting the app in landscape where the view still had portrait dimensions.
  • Deprecate the stdweb backend, to be removed in a future release
  • Breaking: Prefixed virtual key codes Add, Multiply, Divide, Decimal, and Subtract with Numpad.
  • Added Asterisk and Plus virtual key codes.
  • On Web (web-sys only), the Event::LoopDestroyed event is correctly emitted when leaving the page.
  • On Web, the WindowEvent::Destroyed event now gets emitted when a Window is dropped.
  • On Web (web-sys only), the event listeners are now removed when a Window is dropped or when the event loop is destroyed.
  • On Web, the event handler closure passed to EventLoop::run now gets dropped after the event loop is destroyed.
  • Breaking: On Web, the canvas element associated to a Window is no longer removed from the DOM when the Window is dropped.
  • On Web, WindowEvent::Resized is now emitted when Window::set_inner_size is called.
  • Breaking: Fullscreen enum now uses Borderless(Option<MonitorHandle>) instead of Borderless(MonitorHandle) to allow picking the current monitor.
  • On MacOS, fix WindowEvent::Moved ignoring the scale factor.
  • On Wayland, add missing virtual keycodes.
  • On Wayland, implement proper set_cursor_grab.
  • On Wayland, the cursor will use similar icons if the requested one isn't available.
  • On Wayland, right clicking on client side decorations will request application menu.
  • On Wayland, fix tracking of window size after state changes.
  • On Wayland, fix client side decorations not being hidden properly in fullscreen.
  • On Wayland, fix incorrect size event when entering fullscreen with client side decorations.
  • On Wayland, fix resizable attribute not being applied properly on startup.
  • On Wayland, fix disabled repeat rate not being handled.
  • On Wayland, fix decoration buttons not working after tty switch.
  • On Wayland, fix scaling not being applied on output re-enable.
  • On Wayland, fix crash when XCURSOR_SIZE is 0.
  • On Wayland, fix pointer getting created in some cases without pointer capability.
  • On Wayland, on kwin, fix space between window and decorations on startup.
  • Breaking: On Wayland, Theme trait was reworked.
  • On Wayland, disable maximize button for non-resizable window.
  • On Wayland, added support for set_ime_position.
  • On Wayland, fix crash on startup since GNOME 3.37.90.
  • On X11, fix incorrect modifiers state on startup.

v0.22.2

16 May 16:28
49bcec1
Compare
Choose a tag to compare
  • Added Clone implementation for 'static events.
  • On Windows, fix window intermittently hanging when ControlFlow was set to Poll.
  • On Windows, fix WindowBuilder::with_maximized being ignored.
  • On Android, minimal platform support.
  • On iOS, touch positions are now properly converted to physical pixels.
  • On macOS, updated core-* dependencies and cocoa

v0.22.1

01 May 00:32
d560972
Compare
Choose a tag to compare
  • On X11, fix ResumeTimeReached being fired too early.
  • On Web, replaced zero timeout for ControlFlow::Poll with requestAnimationFrame
  • On Web, fix a possible panic during event handling
  • On macOS, fix EventLoopProxy leaking memory for every instance.

v0.22.0

09 Mar 21:02
7a9c17a
Compare
Choose a tag to compare
  • On Windows, fix minor timing issue in wait_until_time_or_msg
  • On Windows, rework handling of request_redraw() to address panics.
  • On macOS, fix set_simple_screen to remember frame excluding title bar.
  • On Wayland, fix coordinates in touch events when scale factor isn't 1.
  • On Wayland, fix color from close_button_icon_color not applying.
  • Ignore locale if unsupported by X11 backend
  • On Wayland, Add HiDPI cursor support
  • On Web, add the ability to query "Light" or "Dark" system theme send ThemeChanged on change.
  • Fix Event::to_static returning None for user events.
  • On Wayland, Hide CSD for fullscreen windows.
  • On Windows, ignore spurious mouse move messages.
  • Breaking: Move ModifiersChanged variant from DeviceEvent to WindowEvent.
  • On Windows, add IconExtWindows trait which exposes creating an Icon from an external file or embedded resource
  • Add BadIcon::OsError variant for when OS icon functionality fails
  • On Windows, fix crash at startup on systems that do not properly support Windows' Dark Mode
  • Revert On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
  • on macOS, fix incorrect ReceivedCharacter events for some key combinations.
  • Breaking: Use i32 instead of u32 for position type in WindowEvent::Moved.

v0.21.0

08 Feb 07:51
v0.21.0
28f0eb5
Compare
Choose a tag to compare
  • On Windows, fixed "error: linking with link.exe failed: exit code: 1120" error on older versions of windows.
  • On macOS, fix set_minimized(true) works only with decorations.
  • On macOS, add hide_application to EventLoopWindowTarget via a new EventLoopWindowTargetExtMacOS trait. hide_application will hide the entire application by calling -[NSApplication hide: nil].
  • On macOS, fix not sending ReceivedCharacter event for specific keys combinations.
  • On macOS, fix CursorMoved event reporting the cursor position using logical coordinates.
  • On macOS, fix issue where unbundled applications would sometimes open without being focused.
  • On macOS, fix run_return does not return unless it receives a message.
  • On Windows, fix bug where RedrawRequested would only get emitted every other iteration of the event loop.
  • On X11, fix deadlock on window state when handling certain window events.
  • WindowBuilder now implements Default.
  • Breaking: WindowEvent::CursorMoved changed to f64 units, preserving high-precision data supplied by most backends
  • On Wayland, fix coordinates in mouse events when scale factor isn't 1
  • On Web, add the ability to provide a custom canvas
  • Breaking: On Wayland, the WaylandTheme struct has been replaced with a Theme trait, allowing for extra configuration