Only listen to removal signal for own session (#182)
This commit is contained in:
parent
f966e28fe5
commit
d92aa6dafe
|
@ -59,6 +59,7 @@ use calloop::{
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LogindSessionImpl {
|
struct LogindSessionImpl {
|
||||||
|
session_id: String,
|
||||||
conn: RefCell<Connection>,
|
conn: RefCell<Connection>,
|
||||||
session_path: DbusPath<'static>,
|
session_path: DbusPath<'static>,
|
||||||
active: AtomicBool,
|
active: AtomicBool,
|
||||||
|
@ -171,6 +172,7 @@ impl LogindSession {
|
||||||
let conn = RefCell::new(conn);
|
let conn = RefCell::new(conn);
|
||||||
|
|
||||||
let internal = Rc::new(LogindSessionImpl {
|
let internal = Rc::new(LogindSessionImpl {
|
||||||
|
session_id: session_id.clone(),
|
||||||
conn,
|
conn,
|
||||||
session_path,
|
session_path,
|
||||||
active: AtomicBool::new(true),
|
active: AtomicBool::new(true),
|
||||||
|
@ -260,6 +262,7 @@ impl LogindSessionImpl {
|
||||||
};
|
};
|
||||||
if &*message.interface().unwrap() == "org.freedesktop.login1.Manager"
|
if &*message.interface().unwrap() == "org.freedesktop.login1.Manager"
|
||||||
&& &*message.member().unwrap() == "SessionRemoved"
|
&& &*message.member().unwrap() == "SessionRemoved"
|
||||||
|
&& message.get1::<String>().unwrap() == self.session_id
|
||||||
{
|
{
|
||||||
error!(self.logger, "Session got closed by logind");
|
error!(self.logger, "Session got closed by logind");
|
||||||
//Ok... now what?
|
//Ok... now what?
|
||||||
|
|
Loading…
Reference in New Issue