summaryrefslogtreecommitdiffstats
path: root/winit/src/multi_window.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-01-19 20:28:45 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-19 20:28:45 +0100
commit7ae7fcb89855002519bab752fd3686106ce448db (patch)
treeac717dbd031e243519b446ab45e5008adef4f5dc /winit/src/multi_window.rs
parent61e3d8502fec7e83c584218e598fa20c79363be3 (diff)
parent9df7bf8ec30ca76016018bc758b4323760e231b0 (diff)
downloadiced-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/multi_window.rs')
-rw-r--r--winit/src/multi_window.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs
index 84c81bea..3f0ba056 100644
--- a/winit/src/multi_window.rs
+++ b/winit/src/multi_window.rs
@@ -24,6 +24,7 @@ use crate::{Clipboard, Error, Proxy, Settings};
use std::collections::HashMap;
use std::mem::ManuallyDrop;
+use std::sync::Arc;
use std::time::Instant;
/// An interactive, native, cross-platform, multi-windowed application.
@@ -150,9 +151,11 @@ where
log::info!("Window builder: {:#?}", builder);
- let main_window = builder
- .build(&event_loop)
- .map_err(Error::WindowCreationFailed)?;
+ let main_window = Arc::new(
+ builder
+ .build(&event_loop)
+ .map_err(Error::WindowCreationFailed)?,
+ );
#[cfg(target_arch = "wasm32")]
{
@@ -184,7 +187,7 @@ where
};
}
- let mut compositor = C::new(compositor_settings, Some(&main_window))?;
+ let mut compositor = C::new(compositor_settings, main_window.clone())?;
let mut window_manager = WindowManager::new();
let _ = window_manager.insert(
@@ -388,7 +391,7 @@ async fn run_instance<A, E, C>(
} => {
let window = window_manager.insert(
id,
- window,
+ Arc::new(window),
&application,
&mut compositor,
exit_on_close_request,