Skip to content

Commit

Permalink
Merge pull request #1207 from i509VCB/shell-client-unresponsive
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix authored Nov 7, 2023
2 parents 3058eb3 + b84671f commit 5e5a739
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/wayland/shell/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,21 @@ impl ShellClient {
Ok(())
}

/// Kill the shell client for being unresponsive.
///
/// Generally this will be used if the client does not respond to a ping in a reasonable amount of time.
pub fn unresponsive(&self) -> Result<(), crate::utils::DeadResource> {
if !self.alive() {
return Err(crate::utils::DeadResource);
}
self.kind.post_error(
xdg_wm_base::Error::Unresponsive,
"client did not respond to ping on time",
);

Ok(())
}

/// Access the user data associated with this shell client
pub fn with_data<F, T>(&self, f: F) -> Result<T, crate::utils::DeadResource>
where
Expand Down

0 comments on commit 5e5a739

Please sign in to comment.