From 81b483e7acde60f177b4d79ed2d21c19ea9ae931 Mon Sep 17 00:00:00 2001 From: Khoa Vo Date: Wed, 1 Jul 2026 11:59:40 +0700 Subject: [PATCH] fix: AT-SPI2 connects to a11y bus, not session bus (password detection was silently failing) --- daemon/src/password_detector.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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(