Skip to content

Releases: rust-windowing/winit

v0.20.0-alpha2

08 Feb 07:49
v0.20.0-alpha2
ce5cf97
Compare
Choose a tag to compare
v0.20.0-alpha2 Pre-release
Pre-release
  • On X11, non-resizable windows now have maximize explicitly disabled.
  • On Windows, support paths longer than MAX_PATH (260 characters) in WindowEvent::DroppedFile
    and WindowEvent::HoveredFile.
  • On Mac, implement DeviceEvent::Button.
  • Change Event::Suspended(true / false) to Event::Suspended and Event::Resumed.
  • On X11, fix sanity check which checks that a monitor's reported width and height (in millimeters) are non-zero when calculating the DPI factor.
  • Revert the use of invisible surfaces in Wayland, which introduced graphical glitches with OpenGL (#835)
  • On X11, implement _NET_WM_PING to allow desktop environment to kill unresponsive programs.
  • On Windows, when a window is initially invisible, it won't take focus from the existing visible windows.
  • On Windows, fix multiple calls to request_redraw during EventsCleared sending multiple RedrawRequested events.
  • On Windows, fix edge case where RedrawRequested could be dispatched before input events in event loop iteration.
  • On Windows, fix timing issue that could cause events to be improperly dispatched after RedrawRequested but before EventsCleared.
  • On macOS, drop unused Metal dependency.
  • On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
  • On Windows, fix with_maximized not properly setting window size to entire window.
  • On macOS, change WindowExtMacOS::request_user_attention() to take an enum instead of a bool.

v0.20.0-alpha1

08 Feb 07:48
v0.20.0-alpha1
8d6e8bb
Compare
Choose a tag to compare
v0.20.0-alpha1 Pre-release
Pre-release
  • Changes below are considered breaking.
  • Change all occurrences of EventsLoop to EventLoop.
  • Previously flat API is now exposed through event, event_loop, monitor, and window modules.
  • os module changes:
    • Renamed to platform.
    • All traits now have platform-specific suffixes.
    • Exposes new desktop module on Windows, Mac, and Linux.
  • Changes to event loop types:
    • EventLoopProxy::wakeup has been removed in favor of send_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.
      • ControlFlow's variants have been replaced with Wait, WaitUntil(Instant), Poll, and Exit.
        • 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.
      • Takes a closure that implements 'static + FnMut(Event<T>, &EventLoop<T>, &mut ControlFlow).
        • &EventLoop<T> is provided to allow new Windows to be created.
    • Major: platform::desktop module exposes EventLoopExtDesktop trait with run_return method.
      • Behaves identically to run, but returns control flow to the calling context and can take non-'static closures.
    • EventLoop's poll_events and run_forever methods have been removed in favor of run and run_return.
  • Changes to events:
    • Remove Event::Awakened in favor of Event::UserEvent(T).
      • Can be sent with EventLoopProxy::send_event.
    • Rename WindowEvent::Refresh to WindowEvent::RedrawRequested.
      • RedrawRequested can be sent by the user with the Window::request_redraw method.
    • EventLoop, EventLoopProxy, and Event are now generic over T, for use in UserEvent.
    • Major: Add NewEvents(StartCause), EventsCleared, and LoopDestroyed variants to Event.
      • NewEvents is emitted when new events are ready to be processed by event loop.
        • StartCause describes why new events are available, with ResumeTimeReached, Poll, WaitCancelled, and Init (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 the run or run_return method is about to exit.
  • Rename MonitorId to MonitorHandle.
  • Removed serde implementations from ControlFlow.
  • Rename several functions to improve both internal consistency and compliance with Rust API guidelines.
  • Remove WindowBuilder::multitouch field, since it was only implemented on a few platforms. Multitouch is always enabled now.
  • Breaking: On macOS, change ns identifiers to use snake_case for consistency with iOS's ui identifiers.
  • Add MonitorHandle::video_modes method for retrieving supported video modes for the given monitor.
  • On Wayland, the window now exists even if nothing has been drawn.
  • On Windows, fix initial dimensions of a fullscreen window.
  • On Windows, Fix transparent borderless windows rendering wrong.

v0.19.1

07 May 23:07
cd5caf6
Compare
Choose a tag to compare
  • On Wayland, added a get_wayland_display function to EventsLoopExt.
  • On Windows, fix CursorMoved(0, 0) getting dispatched on window focus.
  • On macOS, fix command key event left and right reverse.
  • On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend.
  • On Windows, fix icon not showing up in corner of window.
  • On X11, change DPI scaling factor behavior. First, winit tries to read it from "Xft.dpi" XResource, and uses DPI calculation from xrandr dimensions as fallback behavior.

v0.18.0

07 Nov 05:43
Compare
Choose a tag to compare
  • Breaking: image crate upgraded to 0.20. This is exposed as part of the icon_loading API.
  • On Wayland, pointer events will now provide the current modifiers state.
  • On Wayland, titles will now be displayed in the window header decoration.
  • On Wayland, key repetition is now ended when keyboard loses focus.
  • On Wayland, windows will now use more stylish and modern client side decorations.
  • On Wayland, windows will use server-side decorations when available.
  • Breaking: Added support for F16-F24 keys (variants were added to the VirtualKeyCode enum).
  • Fixed graphical glitches when resizing on Wayland.
  • On Windows, fix freezes when performing certain actions after a window resize has been triggered. Reintroduces some visual artifacts when resizing.
  • Updated window manager hints under X11 to v1.5 of Extended Window Manager Hints.
  • Added WindowBuilderExt::with_gtk_theme_variant to X11-specific WindowBuilder functions.
  • Fixed UTF8 handling bug in X11 set_title function.
  • On Windows, Window::set_cursor now applies immediately instead of requiring specific events to occur first.
  • On Windows, the HoveredFile and HoveredFileCancelled events are now implemented.
  • On Windows, fix Window::set_maximized.
  • On Windows 10, fix transparency (#260).
  • On macOS, fix modifiers during key repeat.
  • Implemented the Debug trait for Window, EventsLoop, EventsLoopProxy and WindowBuilder.
  • On X11, now a Resized event will always be generated after a DPI change to ensure the window's logical size is consistent with the new DPI.
  • Added further clarifications to the DPI docs.
  • On Linux, if neither X11 nor Wayland manage to initialize, the corresponding panic now consists of a single line only.
  • Add optional serde feature with implementations of Serialize/Deserialize for DPI types and various event types.
  • Add PartialEq, Eq, and Hash implementations on public types that could have them but were missing them.
  • On X11, drag-and-drop receiving an unsupported drop type can no longer cause the WM to freeze.
  • Fix issue whereby the OpenGL context would not appear at startup on macOS Mojave (#1069).
  • Breaking: Removed From<NSApplicationActivationPolicy> impl from ActivationPolicy on macOS.
  • On macOS, the application can request the user's attention with WindowExt::request_user_attention.

v0.17.2

19 Aug 22:30
Compare
Choose a tag to compare
  • On macOS, fix <C-Tab> so applications receive the event.
  • On macOS, fix <Cmd-{key}> so applications receive the event.
  • On Wayland, key press events will now be repeated.

v0.17.1

19 Aug 22:29
b2b740f
Compare
Choose a tag to compare
  • On X11, prevent a compilation failure in release mode for versions of Rust greater than or equal to 1.30.
  • Fixed deadlock that broke fullscreen mode on Windows.

v0.17.0

02 Aug 20:27
Compare
Choose a tag to compare
  • Cocoa and core-graphics updates.
  • Fixed thread-safety issues in several Window functions on Windows.
  • On MacOS, the key state for modifiers key events is now properly set.
  • On iOS, the view is now set correctly. This makes it possible to render things (instead of being stuck on a black screen), and touch events work again.
  • Added NetBSD support.
  • Breaking: On iOS, UIView is now the default root view. WindowBuilderExt::with_root_view_class can be used to set the root view objective-c class to GLKView (OpenGLES) or MTKView (Metal/MoltenVK).
  • On iOS, the UIApplication is not started until Window::new is called.
  • Fixed thread unsafety with cursor hiding on macOS.
  • On iOS, fixed the size of the JmpBuf type used for setjmp/longjmp calls. Previously this was a buffer overflow on most architectures.
  • On Windows, use cached window DPI instead of repeatedly querying the system. This fixes sporadic crashes on Windows 7.

v0.16.2

07 Jul 21:22
Compare
Choose a tag to compare
  • On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
  • Corrected incorrect unreachable! usage when guessing the DPI factor with no detected monitors.

v0.16.1

03 Jul 00:15
1703d04
Compare
Choose a tag to compare
  • Added logging through log. Logging will become more extensive over time.
  • On X11 and Windows, the window's DPI factor is guessed before creating the window. This greatly cuts back on unsightly auto-resizing that would occur immediately after window creation.
  • Fixed X11 backend compilation for environments where c_char is unsigned.

v0.16.0

25 Jun 20:47
089816d
Compare
Choose a tag to compare
  • Windows additionally has WindowBuilderExt::with_no_redirection_bitmap.
  • Breaking: Removed VirtualKeyCode::LMenu and VirtualKeyCode::RMenu; Windows now generates VirtualKeyCode::LAlt and VirtualKeyCode::RAlt instead.
  • On X11, exiting fullscreen no longer leaves the window in the monitor's top left corner.
  • Breaking: Window::hidpi_factor has been renamed to Window::get_hidpi_factor for better consistency. WindowEvent::HiDPIFactorChanged has been renamed to WindowEvent::HiDpiFactorChanged. DPI factors are always represented as f64 instead of f32 now.
  • The Windows backend is now DPI aware. WindowEvent::HiDpiFactorChanged is implemented, and MonitorId::get_hidpi_factor and Window::hidpi_factor return accurate values.
  • Implemented WindowEvent::HiDpiFactorChanged on X11.
  • On macOS, Window::set_cursor_position is now relative to the client area.
  • On macOS, setting the maximum and minimum dimensions now applies to the client area dimensions rather than to the window dimensions.
  • On iOS, MonitorId::get_dimensions has been implemented and both MonitorId::get_hidpi_factor and Window::get_hidpi_factor return accurate values.
  • On Emscripten, MonitorId::get_hidpi_factor now returns the same value as Window::get_hidpi_factor (it previously would always return 1.0).
  • Breaking: The entire API for sizes, positions, etc. has changed. In the majority of cases, winit produces and consumes positions and sizes as LogicalPosition and LogicalSize, respectively. The notable exception is MonitorId methods, which deal in PhysicalPosition and PhysicalSize. See the documentation for specifics and explanations of the types. Additionally, winit automatically conserves logical size when the DPI factor changes.
  • Breaking: All deprecated methods have been removed. For Window::platform_display and Window::platform_window, switch to the appropriate platform-specific WindowExt methods. For Window::get_inner_size_points and Window::get_inner_size_pixels, use the LogicalSize returned by Window::get_inner_size and convert as needed.
  • HiDPI support for Wayland.
  • EventsLoop::get_available_monitors and EventsLoop::get_primary_monitor now have identical counterparts on Window, so this information can be acquired without an EventsLoop borrow.
  • AvailableMonitorsIter now implements Debug.
  • Fixed quirk on macOS where certain keys would generate characters at twice the normal rate when held down.
  • On X11, all event loops now share the same XConnection.
  • Breaking: Window::set_cursor_state and CursorState enum removed in favor of the more composable Window::grab_cursor and Window::hide_cursor. As a result, grabbing the cursor no longer automatically hides it; you must call both methods to retain the old behavior on Windows and macOS. Cursor::NoneCursor has been removed, as it's no longer useful.
  • Breaking: Window::set_cursor_position now returns Result<(), String>, thus allowing for Box<Error> conversion via ?.