wayland: attempt to log protocol errors on failure to flush

When failing to flush, and the error is EPIPE, attempt to read and
dispatch events. This ensures protocol errors are logged.
This commit is contained in:
Daniel Eklöf 2025-05-02 13:46:18 +02:00
parent 237db6e771
commit 5080e271c2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2247,7 +2247,14 @@ wayl_flush(struct wayland *wayl)
}
if (errno != EAGAIN) {
LOG_ERRNO("failed to flush wayland socket");
const int saved_errno = errno;
if (errno == EPIPE) {
wl_display_read_events(wayl->display);
wl_display_dispatch_pending(wayl->display);
}
LOG_ERRNO_P(saved_errno, "failed to flush wayland socket");
return;
}