diff --git a/Cargo.lock b/Cargo.lock index e90210f5..e5e28b32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -833,6 +833,7 @@ dependencies = [ "cosmic-text", "egui", "egui_plot", + "futures-executor", "i18n-embed", "i18n-embed-fl", "iced_tiny_skia", diff --git a/Cargo.toml b/Cargo.toml index a2ae94f6..394d19f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,6 +87,7 @@ reis = { version = "0.5", features = ["calloop"] } clap_lex = "0.7" parking_lot = "0.12.5" logind-zbus = { version = "5.3.2", optional = true } +futures-executor = { version = "0.3.31", features = ["thread-pool"] } [dependencies.id_tree] branch = "feature/copy_clone" diff --git a/src/state.rs b/src/state.rs index 2e900845..1dc7b6ef 100644 --- a/src/state.rs +++ b/src/state.rs @@ -33,6 +33,7 @@ use crate::{ use anyhow::Context; use calloop::RegistrationToken; use cosmic_comp_config::output::comp::{OutputConfig, OutputState}; +use futures_executor::ThreadPool; use i18n_embed::{ DesktopLanguageRequester, fluent::{FluentLanguageLoader, fluent_language_loader}, @@ -211,6 +212,7 @@ pub struct Common { pub display_handle: DisplayHandle, pub event_loop_handle: LoopHandle<'static, State>, pub event_loop_signal: LoopSignal, + pub async_executor: ThreadPool, pub popups: PopupManager, pub shell: Arc>, @@ -710,6 +712,7 @@ impl State { display_handle: dh.clone(), event_loop_handle: handle, event_loop_signal: signal, + async_executor: ThreadPool::builder().pool_size(1).create().unwrap(), popups: PopupManager::default(), shell,