Skip to content

Commit

Permalink
Don't exit-program on X11 selection-event protocol errors
Browse files Browse the repository at this point in the history
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 just
quietly ignore such errors.
  • Loading branch information
loops committed Sep 14, 2024
1 parent 30345b3 commit 0d75324
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions window/src/os/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,13 +999,13 @@ impl XWindowInner {
// whatever STRING represents; let's just assume that
// the other end is going to handle it correctly.
if let Some(text) = self.copy_and_paste.clipboard(clipboard) {
conn.send_request_no_reply(&xcb::x::ChangeProperty {
let _ = conn.send_request_no_reply(&xcb::x::ChangeProperty {
mode: PropMode::Replace,
window: request.requestor(),
property: request.property(),
r#type: request.target(),
data: text.as_bytes(),
})?;
});
// let the requestor know that we set their property
request.property()
} else {
Expand All @@ -1025,7 +1025,7 @@ impl XWindowInner {
selprop
);

conn.send_request_no_reply(&xcb::x::SendEvent {
let _ = conn.send_request_no_reply(&xcb::x::SendEvent {
propagate: true,
destination: xcb::x::SendEventDest::Window(request.requestor()),
event_mask: xcb::x::EventMask::empty(),
Expand All @@ -1036,7 +1036,7 @@ impl XWindowInner {
request.target(),
selprop, // the disposition from the operation above
),
})?;
});

Ok(())
}
Expand Down

0 comments on commit 0d75324

Please sign in to comment.