fix(dbus): Block on creation of zbus connection to avoid deadlock

A fix for the issue reported in
https://github.com/pop-os/cosmic-comp/pull/2450.

Using `block_on` in some places for zbus calls is fine (that's what
zbus's blocking API does; it has its own executor for background tasks),
but this is problematic with `async_once_cell`. If we also use that in
the calloop async executor.

I think ideally we should avoid blocking the main thread on any async
tasks, but for now we can just block in initialization here.
This commit is contained in:
Ian Douglas Scott 2026-06-09 07:51:44 -07:00 committed by Ashley Wulber
parent 94e9437c4e
commit 5153d497e7
3 changed files with 9 additions and 20 deletions

7
Cargo.lock generated
View file

@ -242,12 +242,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "async-once-cell"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
[[package]]
name = "async-process"
version = "2.5.0"
@ -835,7 +829,6 @@ name = "cosmic-comp"
version = "1.0.0"
dependencies = [
"anyhow",
"async-once-cell",
"bitflags 2.11.0",
"calloop 0.14.4",
"cgmath",