From 8fb1e2187356c6a39a57ee403b5ed5bbda1fa2e2 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Wed, 16 Oct 2024 15:20:21 -0400 Subject: [PATCH] add reserved Id --- winit/src/program.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/winit/src/program.rs b/winit/src/program.rs index 76806bd6..01916650 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -198,7 +198,13 @@ where let task = if let Some(window_settings) = window_settings { let mut task = Some(task); - let (_id, open) = runtime::window::open(window_settings); + let open = iced_runtime::task::oneshot(|channel| { + iced_runtime::Action::Window(iced_runtime::window::Action::Open( + iced_runtime::core::window::Id::RESERVED, + window_settings, + channel, + )) + }); open.then(move |_| task.take().unwrap_or(Task::none())) } else { @@ -357,9 +363,6 @@ where return; }; - // XXX what to do if the program is a daemon? - // Can we avoid creating a useless window that hangs around forever? - let window: Arc = match event_loop .create_window( winit::window::WindowAttributes::default()