add reserved Id

This commit is contained in:
Ashley Wulber 2024-10-16 15:20:21 -04:00
parent 64ef6b2724
commit 8fb1e21873
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -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<dyn winit::window::Window> = match event_loop
.create_window(
winit::window::WindowAttributes::default()