aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-05-02 11:43:59 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-05-02 11:43:59 +0000
commit237db6e771293689d6739de5aac7358d35dce5d3 (patch)
tree05a41d230726ac11e18628541e70e73bbdbc8a87
parentPaste URL/regex selection to prompt if key is uppercase. (diff)
wayland: always call wl_display_dispatch_pending() at least once, after reading
This fixes an issue where protocol errors aren't reported. I'm guessing the read succeeds, but that prepare_read() _also_ succeeds immediately, since there aren't any events to dispatch (only log the protocol error). By calling dispatch unconditionally, we ensure any error messages are printed. Then we proceed to loop prepare_read() + dispatch_pending() until the queue is empty.
-rw-r--r--wayland.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wayland.c b/wayland.c
index 320f03aa..a41b5060 100644
--- a/wayland.c
+++ b/wayland.c
@@ -1650,6 +1650,8 @@ fdm_wayl(struct fdm *fdm, int fd, int events, void *data)
return false;
}
+ 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");