From c9b551f59c6b37d4b877839f7abc62c1e1511b8f Mon Sep 17 00:00:00 2001 From: Visal Vijay <150381094+B2krobbery@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:37:58 +0530 Subject: xwayland: handle transient read errors in selection transfer (#14135) --- src/xwayland/XWM.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp index 7e20d9b1..665aedfb 100644 --- a/src/xwayland/XWM.cpp +++ b/src/xwayland/XWM.cpp @@ -1468,6 +1468,11 @@ int SXSelection::onRead(int fd, uint32_t mask) { ssize_t bytesRead = read(fd, transfer->data.data() + oldSize, INCR_CHUNK_SIZE - 1); if (bytesRead < 0) { + if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { + transfer->data.resize(oldSize); + return 1; + } + Log::logger->log(Log::ERR, "[xwm] readDataSource died"); g_pXWayland->m_wm->selectionSendNotify(&transfer->request, false); transfers.erase(it); -- cgit v1.2.3