diff options
author | 2024-01-19 20:28:45 +0100 | |
---|---|---|
committer | 2024-01-19 20:28:45 +0100 | |
commit | 7ae7fcb89855002519bab752fd3686106ce448db (patch) | |
tree | ac717dbd031e243519b446ab45e5008adef4f5dc /winit/src/application.rs | |
parent | 61e3d8502fec7e83c584218e598fa20c79363be3 (diff) | |
parent | 9df7bf8ec30ca76016018bc758b4323760e231b0 (diff) | |
download | iced-7ae7fcb89855002519bab752fd3686106ce448db.tar.gz iced-7ae7fcb89855002519bab752fd3686106ce448db.tar.bz2 iced-7ae7fcb89855002519bab752fd3686106ce448db.zip |
Merge pull request #2191 from ids1024/raw-window-handle-0.6
Update `wgpu` to `0.19`, `glyphon` to `0.5`, `softbuffer` to `0.4`, `window-clipboard` to `0.4`, and `raw-window-handle` to `0.6`
Diffstat (limited to 'winit/src/application.rs')
-rw-r--r-- | winit/src/application.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index bf48538d..09bf63cc 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -24,6 +24,7 @@ use crate::{Clipboard, Error, Proxy, Settings}; use futures::channel::mpsc; use std::mem::ManuallyDrop; +use std::sync::Arc; /// An interactive, native cross-platform application. /// @@ -149,9 +150,11 @@ where log::debug!("Window builder: {builder:#?}"); - let window = builder - .build(&event_loop) - .map_err(Error::WindowCreationFailed)?; + let window = Arc::new( + builder + .build(&event_loop) + .map_err(Error::WindowCreationFailed)?, + ); #[cfg(target_arch = "wasm32")] { @@ -183,7 +186,7 @@ where }; } - let compositor = C::new(compositor_settings, Some(&window))?; + let compositor = C::new(compositor_settings, window.clone())?; let mut renderer = compositor.create_renderer(); for font in settings.fonts { @@ -248,7 +251,7 @@ async fn run_instance<A, E, C>( >, mut control_sender: mpsc::UnboundedSender<winit::event_loop::ControlFlow>, init_command: Command<A::Message>, - window: winit::window::Window, + window: Arc<winit::window::Window>, should_be_visible: bool, exit_on_close_request: bool, ) where @@ -268,7 +271,7 @@ async fn run_instance<A, E, C>( let mut clipboard = Clipboard::connect(&window); let mut cache = user_interface::Cache::default(); let mut surface = compositor.create_surface( - &window, + window.clone(), physical_size.width, physical_size.height, ); |