From ecf42b97df85df25b1b825f37adfeb00f658f6ee Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 7 Mar 2024 23:25:24 +0100 Subject: Fix `block_on` in `iced_wgpu` hanging Wasm builds --- graphics/src/compositor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'graphics/src') 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( settings: Self::Settings, compatible_window: W, - ) -> Result; + ) -> impl Future>; /// Creates a [`Self::Renderer`] for the [`Compositor`]. fn create_renderer(&self) -> Self::Renderer; -- cgit