From d92aa6dafe6a30ddf61637a6c8f3ea63d3d731f8 Mon Sep 17 00:00:00 2001 From: Chandler Newman Date: Sun, 12 Apr 2020 16:00:19 +0100 Subject: [PATCH] Only listen to removal signal for own session (#182) --- src/backend/session/dbus/logind.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/session/dbus/logind.rs b/src/backend/session/dbus/logind.rs index 56e86e7..a1deb65 100644 --- a/src/backend/session/dbus/logind.rs +++ b/src/backend/session/dbus/logind.rs @@ -59,6 +59,7 @@ use calloop::{ }; struct LogindSessionImpl { + session_id: String, conn: RefCell, session_path: DbusPath<'static>, active: AtomicBool, @@ -171,6 +172,7 @@ impl LogindSession { let conn = RefCell::new(conn); let internal = Rc::new(LogindSessionImpl { + session_id: session_id.clone(), conn, session_path, active: AtomicBool::new(true), @@ -260,6 +262,7 @@ impl LogindSessionImpl { }; if &*message.interface().unwrap() == "org.freedesktop.login1.Manager" && &*message.member().unwrap() == "SessionRemoved" + && message.get1::().unwrap() == self.session_id { error!(self.logger, "Session got closed by logind"); //Ok... now what?