1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-05 12:15:23 +03:00

Don't exit-program on X11 selection-event protocol errors

There are situations where transient xcb errors can be generated
  in regard to copy/paste selection.  One example was reported
  in connection with "wl-clip-persist" in issue #6128.  And another
  in issue #5482.

  But there's no reason for us to terminate in response, so catch
  and report any selection-related errors, as per code review in
  PR  #6135
This commit is contained in:
Sean Estabrooks 2024-09-14 11:27:08 -04:00 committed by Wez Furlong
parent 5212cd4c1d
commit 9668fa9481

View File

@ -795,13 +795,21 @@ impl XWindowInner {
conn.child_to_parent_id.borrow_mut().remove(&self.child_id);
}
Event::X(xcb::x::Event::SelectionClear(e)) => {
self.selection_clear(e)?;
if let Err(err) = self.selection_clear(e) {
log::error!("Error handling SelectionClear: {err:#}");
}
}
Event::X(xcb::x::Event::SelectionRequest(e)) => {
self.selection_request(e)?;
if let Err(err) = self.selection_request(e) {
// Don't propagate this, as it is not worth exiting the program over it.
// <https://github.com/wez/wezterm/pull/6135>
log::error!("Error handling SelectionRequest: {err:#}");
}
}
Event::X(xcb::x::Event::SelectionNotify(e)) => {
self.selection_notify(e)?;
if let Err(err) = self.selection_notify(e) {
log::error!("Error handling SelectionNotify: {err:#}");
}
}
Event::X(xcb::x::Event::PropertyNotify(msg)) => {
let atom_name = conn.atom_name(msg.atom());