From 0d7532483ceaac0c29f527743691efa9d6859b67 Mon Sep 17 00:00:00 2001 From: Sean Estabrooks Date: Fri, 13 Sep 2024 16:20:24 -0400 Subject: [PATCH] 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 just quietly ignore such errors. --- window/src/os/x11/window.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs index 58ec4f8936f..aa86330ee21 100644 --- a/window/src/os/x11/window.rs +++ b/window/src/os/x11/window.rs @@ -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 { @@ -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(), @@ -1036,7 +1036,7 @@ impl XWindowInner { request.target(), selprop, // the disposition from the operation above ), - })?; + }); Ok(()) }