Skip to content

Commit 84ab051

Browse files
committed
feat(wayland): log pid on client disconnect
1 parent f36c862 commit 84ab051

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/wayland/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,23 @@ impl WaylandClient {
152152
// wayland clients really aren't nice when disconnecting properly, are they? :p
153153
if let server::Error::Decode(DecodeError::IoError(e)) = &e {
154154
if e.kind() == io::ErrorKind::ConnectionReset {
155-
tracing::info!("Wayland: Client disconnected from server");
155+
if let Some(pid) = client.get::<Display>(ObjectId::DISPLAY).and_then(|d| d.pid) {
156+
tracing::info!("Wayland: Client with pid: {pid} disconnected from server");
157+
} else {
158+
tracing::info!("Wayland: Unknown client disconnected from server");
159+
}
156160
break;
157161
}
158162
}
159163
tracing::error!("Wayland: Error reading message: {:?}", e);
160164
break;
161165
}
162166
Ok(None) => {
167+
if let Some(pid) = client.get::<Display>(ObjectId::DISPLAY).and_then(|d| d.pid) {
168+
tracing::info!("Wayland: Client with pid: {pid} disconnected from server");
169+
} else {
170+
tracing::info!("Wayland: Unknown client disconnected from server");
171+
}
163172
// Message stream ended
164173
break;
165174
}

0 commit comments

Comments
 (0)