summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 23:25:24 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 23:25:24 +0100
commitecf42b97df85df25b1b825f37adfeb00f658f6ee (patch)
tree43ea058c8b7d0b4a13f9fe3ad7015efeea94ed48 /graphics
parent1bb5a1b9a23e1c4739430ac87ca33b06c2f4d9df (diff)
downloadiced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.tar.gz
iced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.tar.bz2
iced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.zip
Fix `block_on` in `iced_wgpu` hanging Wasm builds
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/compositor.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/graphics/src/compositor.rs b/graphics/src/compositor.rs
index 0188f4d8..91951a8e 100644
--- a/graphics/src/compositor.rs
+++ b/graphics/src/compositor.rs
@@ -6,6 +6,7 @@ use crate::core::Color;
use crate::futures::{MaybeSend, MaybeSync};
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
+use std::future::Future;
use thiserror::Error;
/// A graphics compositor that can draw to windows.
@@ -23,7 +24,7 @@ pub trait Compositor: Sized {
fn new<W: Window + Clone>(
settings: Self::Settings,
compatible_window: W,
- ) -> Result<Self, Error>;
+ ) -> impl Future<Output = Result<Self, Error>>;
/// Creates a [`Self::Renderer`] for the [`Compositor`].
fn create_renderer(&self) -> Self::Renderer;