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
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -1049,6 +1049,7 @@ dependencies = [
|
||||||
"smithay-egui",
|
"smithay-egui",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tiny-skia",
|
"tiny-skia",
|
||||||
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-journald",
|
"tracing-journald",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ xdg = "^3.0"
|
||||||
xdg-user = "0.2.1"
|
xdg-user = "0.2.1"
|
||||||
xkbcommon = "0.9"
|
xkbcommon = "0.9"
|
||||||
zbus = "5.14.0"
|
zbus = "5.14.0"
|
||||||
|
tokio = { version = "1", features = ["rt-multi-thread"] }
|
||||||
profiling = { version = "1.0" }
|
profiling = { version = "1.0" }
|
||||||
rustix = { version = "1.1.4", features = ["process"] }
|
rustix = { version = "1.1.4", features = ["process"] }
|
||||||
rand = "0.10"
|
rand = "0.10"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
fn main() {
|
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()) {
|
if let Err(err) = cosmic_comp::run(Default::default()) {
|
||||||
tracing::error!("Error occured in main(): {}", err);
|
tracing::error!("Error occured in main(): {}", err);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue