winit

Window handling library in pure Rust

APACHE-2.0 License

Downloads
13.1M
Stars
4.6K
Committers
459
winit - Winit Version 0.29.1-beta

Published by kchibisov about 1 year ago

  • Breaking: Bump ndk version to 0.8.0-beta.0, ndk-sys to v0.5.0-beta.0, android-activity to 0.5.0-beta.1.
  • Breaking: Bump MSRV from 1.64 to 1.65.
  • Make iOS windows usable from other threads.
  • Reexport raw-window-handle in window module.
  • Breaking: WINIT_UNIX_BACKEND was removed in favor of standard WAYLAND_DISPLAY and DISPLAY variables.
  • Breaking: EventLoop::new and EventLoopBuilder::build now return Result<Self, EventLoopError>
  • On X11, set visual_id in returned raw-window-handle.
  • Breaking: on Wayland, dispatching user created wayland queue won't wake up the loop unless winit has event to send back.
  • Removed platform-specific extensions that should be retrieved through 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.
  • On Web, use Window.requestAnimationFrame() to throttle RedrawRequested events.
  • On Wayland, use frame callbacks to throttle RedrawRequested events so redraws will align with compositor.
  • Add Window::pre_present_notify to notify winit before presenting to the windowing system.
  • On Windows, added WindowBuilderExtWindows::with_class_name to customize the internal class name.
  • Breaking: Remove lifetime parameter from Event and WindowEvent.
  • Breaking: ScaleFactorChanged now contains a writer instead of a reference to update inner size.
  • On iOS, always wake the event loop when transitioning from ControlFlow::Poll to ControlFlow::Poll.
  • Breaking: ActivationTokenDone event which could be requested with the new startup_notify module, see its docs for more.
  • On Wayland, make double clicking and moving the CSD frame more reliable.
  • On macOS, add tabbing APIs on WindowExtMacOS and EventLoopWindowTargetExtMacOS.
  • Breaking: Rename Window::set_inner_size to Window::request_inner_size and indicate if the size was applied immediately.
  • On X11, fix false positive flagging of key repeats when pressing different keys with no release between presses.
  • Implement PartialOrd and Ord for Key, KeyCode, NativeKey, and NativeKeyCode.
  • Add ElementState::is_pressed.
  • On Web, implement WindowEvent::Occluded.
  • On Web, fix touch location to be as accurate as mouse position.
  • On Web, account for CSS padding, border, and margin when getting or setting the canvas position.
  • On Web, add Fullscreen API compatibility for Safari.
  • On Web, implement Window::set_(min|max)_inner_size().
  • On Web, fix some Window methods using incorrect HTML attributes instead of CSS properties.
  • On Web, fix some WindowBuilder methods doing nothing.
  • On Web, implement Window::focus_window().
  • On Web, remove unnecessary Window::is_dark_mode(), which was replaced with Window::theme().
  • On Web, add WindowBuilderExtWebSys::with_append() to append the canvas element to the web page on creation.
  • On Windows, add drag_resize_window method support.
  • Breaking run() ->! has been replaced by run() -> Result<(), EventLoopError> for returning errors without calling std::process::exit() (#2767)
  • Breaking Removed 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().
    • On Windows, RedrawRequested is now driven by WM_PAINT messages which are requested via redraw_request()
  • Breaking LoopDestroyed renamed to LoopExiting (#2900)
  • Breaking RedrawEventsCleared removed (#2900)
  • Breaking MainEventsCleared removed (#2900)
  • Added AboutToWait event which is emitted when the event loop is about to block and wait for new events (#2900)
  • Breaking: with_x11_visual now takes the visual ID instead of the bare pointer.
  • On X11, add a with_embedded_parent_window function to the window builder to allow embedding a window into another window.
  • On iOS, add force data to touch events when using the Apple Pencil.
winit - Winit Version 0.29.0-beta.0

Published by kchibisov over 1 year ago

  • On Web, allow event loops to be recreated with spawn.
  • Breaking: Rename Window::set_ime_position to Window::set_ime_cursor_area adding a way to set exclusive zone.
  • On Android, changed default behavior of Android to ignore volume keys letting the operating system handle them.
  • On Android, added EventLoopBuilderExtAndroid::handle_volume_keys to indicate that the application will handle the volume keys manually.
  • Breaking: Rename DeviceEventFilter to DeviceEvents reversing the behavior of variants.
  • Breaking: Rename EventLoopWindowTarget::set_device_event_filter to listen_device_events.
  • On X11, fix EventLoopWindowTarget::listen_device_events effect being reversed.
  • Breaking: Remove all deprecated modifiers fields.
  • Breaking: Overhaul keyboard input handling.
    • Replace KeyboardInput with KeyEvent and RawKeyEvent.
      • Change WindowEvent::KeyboardInput to contain a KeyEvent.
      • Change Event::Key to contain a RawKeyEvent.
    • Remove Event::ReceivedCharacter. In its place, you should use
      KeyEvent.text in combination with WindowEvent::Ime.
    • Replace VirtualKeyCode with the Key enum.
    • Replace ScanCode with the KeyCode enum.
    • Rename ModifiersState::LOGO to SUPER and ModifiersState::CTRL to CONTROL.
    • Add KeyCode to refer to keys (roughly) by their physical location.
    • Add NativeKeyCode to represent raw KeyCodes which Winit doesn't
      understand.
    • Add Key to represent the keys after they've been interpreted by the
      active (software) keyboard layout.
    • Add NativeKey to represent raw Keys which Winit doesn't understand.
    • Add KeyLocation to tell apart Keys which usually "mean" the same thing,
      but can appear simultaneously in different spots on the same keyboard
      layout.
    • Add Window::reset_dead_keys to enable application-controlled cancellation
      of dead key sequences.
    • Add KeyEventExtModifierSupplement to expose additional (and less
      portable) interpretations of a given key-press.
    • Add KeyCodeExtScancode, which lets you convert between raw keycodes and
      KeyCode.
    • ModifiersChanged now uses dedicated Modifiers struct.
  • On Orbital, fix ModifiersChanged not being sent.
  • Breaking: CursorIcon is now used from the cursor-icon crate.
  • Breaking: CursorIcon::Hand is now named CursorIcon::Pointer.
  • Breaking: CursorIcon::Arrow was removed.
  • On Wayland, fix maximized startup not taking full size on GNOME.
  • On Wayland, fix initial window size not restored for maximized/fullscreened on startup window.
  • On Wayland, Window::outer_size now accounts for client side decorations.
  • On Wayland, fix window not checking that it actually got initial configure event.
  • On Wayland, fix maximized window creation and window geometry handling.
  • On Wayland, fix forward compatibility issues.
  • On Wayland, add Window::drag_resize_window method.
  • On Wayland, drop WINIT_WAYLAND_CSD_THEME variable.
  • Implement PartialOrd and Ord on types in the dpi module.
  • Breaking: Bump MSRV from 1.60 to 1.64.
  • Breaking: On Web, the canvas output bitmap size is no longer adjusted.
  • On Web: fix Window::request_redraw not waking the event loop when called from outside the loop.
  • On Web: fix position of touch events to be relative to the canvas.
  • On Web, fix Window:::set_fullscreen doing nothing when called outside the event loop but during
    a transient activation.
  • On Web, fix pointer button events not being processed when a buttons is already pressed.
  • Breaking: Updated bitflags crate version to 2, which changes the API on exposed types.
  • On Web, handle coalesced pointer events, which increases the resolution of pointer inputs.
  • Breaking: On Web, instant is now replaced by web_time.
  • On Windows, port to windows-sys version 0.48.0.
  • On Web, fix pen treated as mouse input.
  • On Web, send mouse position on button release as well.
  • On Web, fix touch input not gaining or loosing focus.
  • Breaking: On Web, dropped support for Safari versions below 13.1.
  • On Web, prevent clicks on the canvas to select text.
  • On Web, EventLoopProxy now implements Send.
  • On Web, Window now implements Send and Sync.
  • Breaking: WindowExtWebSys::canvas() now returns an Option.
  • On Web, use the correct canvas size when calculating the new size during scale factor change,
    instead of using the output bitmap size.
  • On Web, scale factor and dark mode detection are now more robust.
  • On Web, fix the bfcache by not using the beforeunload event and map bfcache loading/unloading to Suspended/Resumed events.
  • On Web, fix scale factor resize suggestion always overwriting the canvas size.
  • On macOS, fix crash when dropping Window.
  • On Web, use Window.requestIdleCallback() for ControlFlow::Poll when available.
  • Breaking: On Web, the canvas size is not controlled by Winit anymore and external changes to
    the canvas size will be reported through WindowEvent::Resized.
  • On Web, respect EventLoopWindowTarget::listen_device_events() settings.
  • On Web, fix DeviceEvent::MouseMotion only being emitted for each canvas instead of the whole window.
  • On Web, add DeviceEvent::Motion, DeviceEvent::MouseWheel, DeviceEvent::Button and
    DeviceEvent::Key support.
  • Breaking MouseButton now supports Back and Forward variants, emitted from mouse events
    on Wayland, X11, Windows, macOS and Web.
winit - Winit Version v0.28.6

Published by kchibisov over 1 year ago

  • On macOS, fixed memory leak when getting monitor handle.
  • On macOS, fix Backspace being emitted when clearing preedit with it.
winit - Winit Version v0.28.5

Published by kchibisov over 1 year ago

  • On macOS, fix key_up being ignored when Ime is disabled.
winit - Winit Version v0.28.4 [yanked]

Published by kchibisov over 1 year ago

  • On macOS, fix empty marked text blocking regular input.
  • On macOS, fix potential panic when getting refresh rate.
  • On macOS, fix crash when calling Window::set_ime_position from another thread.
winit - Winit Version v0.28.3

Published by kchibisov over 1 year ago

  • Fix macOS memory leaks.
winit - Winit Version v0.28.2

Published by kchibisov over 1 year ago

  • Implement HasRawDisplayHandle for EventLoop.
  • On macOS, set resize increments only for live resizes.
  • On Wayland, fix rare crash on DPI change.
  • On Web, add support for Window::theme.
  • On Wayland, fix rounding issues when doing resize.
  • On macOS, fix wrong focused state on startup.
  • On Windows, fix crash on setting taskbar when using Visual Studio debugger.
  • On macOS, resize simple fullscreen windows on windowDidChangeScreen events.
winit - Winit Version v0.28.1

Published by kchibisov over 1 year ago

  • On Wayland, fix crash when dropping a window in multi-window setup.
winit - Winit Version v0.28.0

Published by kchibisov over 1 year ago

  • On macOS, fixed Ime::Commit persisting for all input after interacting with Ime.
  • On macOS, added WindowExtMacOS::option_as_alt and WindowExtMacOS::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 by Win + D hotkey.
  • Breaking: On Web, touch input no longer fires WindowEvent::Cursor*, WindowEvent::MouseInput, or DeviceEvent::MouseMotion like other platforms, but instead it fires WindowEvent::Touch.
  • Breaking: Removed platform specific WindowBuilder::with_parent API in favor of WindowBuilder::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 and WindowBuilderExtX11::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 of Window::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 and WindowExtMacOS::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 or CAMetalLayer). See vulkano-win or wgpu 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 to WindowBuilder.
  • Added Window::resize_increments/Window::set_resize_increments to update resize increments at runtime for X11/macOS.
  • macOS/iOS: Use objc2 instead of objc internally.
  • Breaking: Bump MSRV from 1.57 to 1.60.
  • Breaking: Split the platform::unix module into platform::x11 and platform::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 and WindowEvent::TouchpadRotate. Also add support for touchpad smart-magnification gesture with a new event WindowEvent::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 uses ab_glyph instead of crossfont to render the title for decorations.
  • On Wayland, a new wayland-csd-adwaita-crossfont feature was added to use crossfont instead of ab_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 and Window::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 and WindowBuilderExtWayland::with_wayland_csd_theme in favour of WindowBuilder::with_theme.
  • Breaking: Removed WindowExtWindows::theme in favour of Window::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 of ndk-glue. See README.md#Android for more details. (#2444)
  • Breaking: Removed support for raw-window-handle version 0.4
  • On Wayland, RedrawRequested not emitted during resize.
  • Add a set_wait_timeout function to ControlFlow to allow waiting for a Duration.
  • 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 - Winit Version v0.27.5

Published by kchibisov almost 2 years ago

  • On Wayland, fix byte offset in Ime::Preedit pointing to invalid bytes.
winit - Winit Version v0.27.4

Published by kchibisov about 2 years ago

  • On Windows, emit ReceivedCharacter events on system keybindings.
  • On Windows, fixed focus event emission on minimize.
  • On X11, fixed IME crashing during reload.
winit - Winit Version v0.27.3

Published by kchibisov about 2 years ago

  • On Windows, added WindowExtWindows::set_undecorated_shadow and WindowBuilderExtWindows::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 before Ime::Commit to help clearing preedit.
  • On X11, fixed IME context picking by querying for supported styles beforehand.
winit - Winit Version v0.27.2

Published by kchibisov about 2 years ago

  • 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 the HasRawWindowHandle trait
  • On Windows, added support for EventLoopWindowTarget::set_device_event_filter.
  • On Wayland, fix user requested WindowEvent::RedrawRequested being delayed by a frame.
winit - Winit Version v0.27.1

Published by kchibisov about 2 years ago

  • 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 - Winit Version v0.27.0

Published by kchibisov about 2 years ago

  • 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.
winit -

Published by ArturKovacs almost 3 years ago

  • 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.
winit - v0.26.0

Published by kchibisov almost 3 years ago

  • 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.
winit - v0.25.0

Published by ArturKovacs over 3 years ago

  • 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).
winit - v0.24.0

Published by kchibisov almost 4 years ago

  • 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.
winit - v0.23.0

Published by kchibisov about 4 years ago

  • 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.
Package Rankings
Top 0.92% on Crates.io
Top 6.66% on Proxy.golang.org
Badges
Extracted from project README
Crates.io Docs.rs Master Docs CI Status Matrix