Provide access to Arc<winit:🪟:Window>

This simplifies managing safely accessing the raw window handle,
allowing the window thread to pass a reference back to the app thread
using an app event.
This commit is contained in:
Jonathan Johnson 2024-09-29 19:53:30 -07:00
parent b95df0cc54
commit 662cebf193
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 2 additions and 1 deletions

View file

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This new function properly updates the `inner_size` and `outer_size` when the This new function properly updates the `inner_size` and `outer_size` when the
underlying window is resized immediately. Notably, this happens on Wayland but underlying window is resized immediately. Notably, this happens on Wayland but
may happen on some other platforms as well. may happen on some other platforms as well.
- `RunningWindow::winit` now returns an `Arc` wrapped winit window.
### Added ### Added

View file

@ -318,7 +318,7 @@ where
{ {
/// Returns a reference to the underlying window. /// Returns a reference to the underlying window.
#[must_use] #[must_use]
pub fn winit(&self) -> &winit::window::Window { pub fn winit(&self) -> &Arc<winit::window::Window> {
&self.window &self.window
} }