linux/x11: Don't stop worker thread if handling selection request fails (#186)

* linux/x11: Don't stop worker thread if handling selection request fails

Just because one request fails, that doesn't mean we can't handle
subsequent requests.
Stopping the worker thread on failure means that every subsequent
request will fail, which is usually undesirable.
This commit is contained in:
crumblingstatue 2025-06-24 21:11:45 +02:00 committed by GitHub
parent b1e6720c3e
commit 5f80bc1ddf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -847,7 +847,10 @@ fn serve_requests(context: Arc<Inner>) -> Result<(), Box<dyn std::error::Error>>
context.atom_name_dbg(event.target),
);
// Someone is requesting the clipboard content from us.
context.handle_selection_request(event).map_err(into_unknown)?;
if let Err(e) = context.handle_selection_request(event) {
error!("Failed to handle selection request: {e}");
continue;
}
// if we are in the progress of saving to the clipboard manager
// make sure we save that we have finished writing