aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/wayland.c b/wayland.c
index e1055101..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) {
@@ -1589,14 +1593,21 @@ void
wayl_roundtrip(struct wayland *wayl)
{
wl_display_cancel_read(wayl->display);
- wl_display_roundtrip(wayl->display);
+ if (wl_display_roundtrip(wayl->display) < 0) {
+ LOG_ERRNO("failed to roundtrip Wayland display");
+ return;
+ }
/* I suspect the roundtrip above clears the pending queue, and
* that prepare_read() will always succeed in the first call. But,
* better safe than sorry... */
- 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;
+ }
+ }
wayl_flush(wayl);
}