All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Window::set_inner_size
has been replaced withWindow::request_inner_size
, and it matches the semantics of winit's underlyingrequest_inner_size
. The function returns an option containing the new size if the size was able to be applied before the function returns.This new function properly updates the
inner_size
andouter_size
when the underlying window is resized immediately. Notably, this happens on Wayland but may happen on some other platforms as well. -
RunningWindow::winit
now returns anArc
wrapped winit window. -
AppMessage::Error
is a new associated type that is used to communicate errors from window threads to the event loop. To facilitate this communication,App::send_error
andApplication::send_error
have been added.Additionally,
WindowBehavior::Initialize
now returns aResult<Self, AppMessage::Error>
.To install a hander, use
PendingApp::on_error
.
- A new feature
xdg
has been added, enabled by default, that enables detecting dark mode changes on Linux.
-
Several functions now accept an
ExecutingApp
parameter instead of aWindows
parameter. This new type exposes access to other information from the event loop such as monitor information. The affected APIs are:PendingApp::new_with_event_callback
WindowBehavior::run_with_event_callback
WindowBehavior::run_with_context_and_event_callback
-
RunningWindow::position
has been split intoRunningWindow::inner_position
andRunningWindow::outer_position
.RunningWindow::set_position
has been renamed toRunningWindow::set_outer_position
.
Window
'sClone
implementation no longer requires its generic parameter to implementClone
.WindowAttributes::active
is now honored when usingdelay_visible
.
PendingApp::on_startup
accepts a callback that will be invoked once the event loop is executing.WindowBehavior::moved
is called when the window moves.RunningWindow::outer_size
is a new function that returns the window's current size including decorations.App::prevent_shutdown()
returns a guard that prevents the application from closing automatically when the final window is closed.WindowBehavior::initialized
is called once when the window has been fully initialized. This happens after thedelay_visible
logic has been executed.
AsApplication
is now explicitly implemented forApp
andPendingApp
rather than implemented using a blanket implementation. This allows downstream crates to create wrappers of these types that can implementAsApplication
.
- When multiple windows are open, windows now properly close fully without requiring that all windows are closed.
WindowAttributes::delay_visible
is a new setting initializes the windowvisible: false
before showing it after the first successful redraw. The goal is to avoid the OS drawing an empty window before the window behavior has initialized. This new attribute defaults to true.
- This crate no longer specifies a specific raw-window-handle flag for winit.
This crate will maintain feature flags that allow picking whatever versions
winit is exposing. As of writing this note, the choices are
rwh_05
andrwh_06
.rwh_05
was the feature that was activated in v0.2.0. winit
has been updated to 0.30.0.Window::id
now returnsOption<WindowId>
, as a window may be opened before the event loop has been started.WindowBehavior::build
,WindowBehavior::build_with
,WindowBehavior::open
, andWindowBehavior::open_with
now require exclusive references to the application.- These gesture events have been renamed to match
winit
's updated nomenclature:WindowBehavior::touchpad_magnify
->WindowBehavior::pinch_gesture
WindowBehavior::smart_magnify
->WindowBehavior::double_tap_gesture
- All
&Appplication
bounds now are?Sized
, enabling&dyn Application
parameters. - Redraw requests from
winit
now block the event loop thread until the window has been repainted.
AsApplication
now providesas_application_mut
.WindowBeahvior::pan_gesture
is a new event provided bywinit
.
UnwindSafe
is no longer required forWindowBehavior
orWindowBehavior::Context
.
- This crate's default features now include
wayland-csd-adwaita
. This enables winit's built-in decoration drawing on Wayland.
App
now implementsApplication
.Window
is now fully weak. Previously the channel for messages would still remain allocated while instances ofWindow
existed. Now, the messages channel is freed as soon as the window is closed.
AsApplication
is a new trait that can be implemented to resolve to theApp
type. This allows wrapper types to be written that hide the appit types.WindowAttributes
now implementDebug
.
- Errors when building for Windows have been resolved.
This is the initial alpha release.