diff --git a/daemon/src/password_detector.rs b/daemon/src/password_detector.rs index 1ae9f86..2d76384 100644 --- a/daemon/src/password_detector.rs +++ b/daemon/src/password_detector.rs @@ -33,8 +33,25 @@ impl PasswordDetector { self.cached } - fn check_atspi2(&self) -> Option { + /// Get the AT-SPI2 accessibility bus address via session bus + fn get_a11y_bus_address() -> Option { let conn = Connection::new_session().ok()?; + let proxy = conn.with_proxy( + "org.a11y.Bus", + "/org/a11y/bus", + Duration::from_secs(2), + ); + let (addr,): (String,) = proxy + .method_call("org.a11y.Bus", "GetAddress", ()) + .ok()?; + Some(addr) + } + + fn check_atspi2(&self) -> Option { + // AT-SPI2 runs on its own private D-Bus (accessibility bus), + // NOT on the session bus. We must first get the a11y bus address. + let addr = Self::get_a11y_bus_address()?; + let conn = Connection::new_address(&addr).ok()?; let timeout = Duration::from_secs(2); let proxy = conn.with_proxy(