diff --git a/wayland.c b/wayland.c index 3c0209d4..99285db3 100644 --- a/wayland.c +++ b/wayland.c @@ -1126,8 +1126,12 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data) return false; } - while (wl_display_prepare_read(wayl->display) != 0) - wl_display_dispatch_pending(wayl->display); + while (wl_display_prepare_read(wayl->display) != 0) { + if (wl_display_dispatch_pending(wayl->display) < 0) { + LOG_ERRNO("failed to dispatch pending Wayland events"); + return false; + } + } } if (events & EPOLLHUP) {