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.
This commit is contained in:
Daniel Eklöf 2025-05-02 13:43:59 +02:00
parent 0ea572dc63
commit 237db6e771
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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");