Skip to content

Commit 7b19429

Browse files
committed
fix
1 parent 1df5b42 commit 7b19429

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/platform/linux.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct LinuxUiBackend {
4747

4848
impl LinuxUiBackend {
4949
pub fn new() -> Result<Self> {
50-
let handle = std::thread::spawn(|| -> Result<(tokio::runtime::Runtime, Connection)> {
50+
fn atspi_init_thread() -> Result<(tokio::runtime::Runtime, Connection)> {
5151
let rt = tokio::runtime::Builder::new_current_thread()
5252
.enable_all()
5353
.build()
@@ -68,10 +68,10 @@ impl LinuxUiBackend {
6868
)
6969
.await
7070
.context("Failed to get AT-SPI bus address from org.a11y.Bus")?
71-
.body()
72-
.deserialize()
71+
.body::<String>()
7372
.context("Failed to deserialize AT-SPI bus address")?;
7473

74+
7575
tracing::info!("Connecting to AT-SPI2 bus at {}", atspi_address);
7676

7777
zbus::ConnectionBuilder::address(atspi_address.as_str())?
@@ -81,7 +81,9 @@ impl LinuxUiBackend {
8181
})?;
8282

8383
Ok((rt, connection))
84-
});
84+
}
85+
86+
let handle = std::thread::spawn(atspi_init_thread);
8587

8688
let (rt, connection) = handle
8789
.join()
@@ -975,7 +977,7 @@ fn send_special_key_linux(key_name: &str) {
975977
.args(["key", "--clearmodifiers", &combo])
976978
.output();
977979
return;
978-
}
980+
},
979981
_ => return,
980982
};
981983

0 commit comments

Comments
 (0)