fix: keep tokio runtime available for compositor
This commit is contained in:
parent
934db82775
commit
56230f0ade
3 changed files with 11 additions and 0 deletions
|
|
@ -1,6 +1,15 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
fn main() {
|
||||
// libcosmic-yoda enables zbus' `tokio` feature, so zbus 5.14 expects an
|
||||
// ambient Tokio runtime via Handle::current(). cosmic-comp's loop is not
|
||||
// async, so hold a runtime guard for the lifetime of run().
|
||||
let runtime = tokio::runtime::Builder::new_multi_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.expect("failed to build tokio runtime");
|
||||
let _guard = runtime.enter();
|
||||
|
||||
if let Err(err) = cosmic_comp::run(Default::default()) {
|
||||
tracing::error!("Error occured in main(): {}", err);
|
||||
std::process::exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue