diff options
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index f6a8a76..021e532 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,7 @@ struct State { } struct Request { - _app_id: String, + app_id: String, path: zvariant::OwnedObjectPath, inhibitor: Option<zvariant::OwnedFd>, } @@ -60,6 +60,7 @@ impl Request { ) -> zbus::fdo::Result<()> { // Drop the file descriptor that represents the inhibitions. self.inhibitor.take(); + eprintln!("{} releases its inhibition handle {}", self.app_id, self.path); // This might not actually deadlock if I'm lucky. object_server .remove::<Self, zvariant::ObjectPath<'_>>(self.path.as_ref()) @@ -135,11 +136,13 @@ impl InhibitService { if (flags & 8) == 8 { what.push("idle"); } + eprintln!("{} requests inhibiting {:?} for reason: {}", app_id, what, options.reason.as_deref().unwrap_or("[no reason specified]")); + eprintln!("Created handle for {}: {}", app_id, handle); object_server .at( handle.clone(), Request { - _app_id: app_id.to_owned(), + app_id: app_id.to_owned(), inhibitor: Some( self.logind .inhibit( @@ -205,7 +208,7 @@ async fn main() -> Result<(), zbus::Error> { }; let _conn = zbus::connection::Builder::session()? .name("xyz.vikanezrimaya.fdo.portal.Systemd")? - .serve_at("/", service)? + .serve_at("/org/freedesktop/portal/desktop", service)? .build() .await?; @@ -222,7 +225,7 @@ async fn main() -> Result<(), zbus::Error> { let service = _conn .object_server() - .interface::<_, InhibitService>("/") + .interface::<_, InhibitService>("/org/freedesktop/portal/desktop") .await?; let locked = dbg!(change.get().await?); let sessions = dbg!(service.get().await.sessions.clone()); |