From 662cebf193a9adc1b2f19cf048fb8a359f74059a Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Sun, 29 Sep 2024 19:53:30 -0700 Subject: [PATCH] Provide access to Arc 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. --- CHANGELOG.md | 1 + src/window.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2369295..464d5fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 underlying window is resized immediately. Notably, this happens on Wayland but may happen on some other platforms as well. +- `RunningWindow::winit` now returns an `Arc` wrapped winit window. ### Added diff --git a/src/window.rs b/src/window.rs index 9cf8a93..8f70dfe 100644 --- a/src/window.rs +++ b/src/window.rs @@ -318,7 +318,7 @@ where { /// Returns a reference to the underlying window. #[must_use] - pub fn winit(&self) -> &winit::window::Window { + pub fn winit(&self) -> &Arc { &self.window }