Fix block_on in iced_wgpu hanging Wasm builds
This commit is contained in:
parent
1bb5a1b9a2
commit
ecf42b97df
8 changed files with 53 additions and 30 deletions
|
|
@ -97,7 +97,7 @@ where
|
|||
|
||||
/// Runs an [`Application`] with an executor, compositor, and the provided
|
||||
/// settings.
|
||||
pub fn run<A, E, C>(
|
||||
pub async fn run<A, E, C>(
|
||||
settings: Settings<A::Flags>,
|
||||
compositor_settings: C::Settings,
|
||||
) -> Result<(), Error>
|
||||
|
|
@ -188,7 +188,7 @@ where
|
|||
};
|
||||
}
|
||||
|
||||
let compositor = C::new(compositor_settings, window.clone())?;
|
||||
let compositor = C::new(compositor_settings, window.clone()).await?;
|
||||
let mut renderer = compositor.create_renderer();
|
||||
|
||||
for font in settings.fonts {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ use crate::core::widget::operation;
|
|||
use crate::core::window;
|
||||
use crate::core::{Point, Size};
|
||||
use crate::futures::futures::channel::mpsc;
|
||||
use crate::futures::futures::{task, Future, StreamExt};
|
||||
use crate::futures::futures::executor;
|
||||
use crate::futures::futures::task;
|
||||
use crate::futures::futures::{Future, StreamExt};
|
||||
use crate::futures::{Executor, Runtime, Subscription};
|
||||
use crate::graphics::{compositor, Compositor};
|
||||
use crate::multi_window::window_manager::WindowManager;
|
||||
|
|
@ -183,7 +185,8 @@ where
|
|||
};
|
||||
}
|
||||
|
||||
let mut compositor = C::new(compositor_settings, main_window.clone())?;
|
||||
let mut compositor =
|
||||
executor::block_on(C::new(compositor_settings, main_window.clone()))?;
|
||||
|
||||
let mut window_manager = WindowManager::new();
|
||||
let _ = window_manager.insert(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue