Check for error while communicating with Wayland.

This commit is contained in:
ManoloFLTK
2022-08-06 10:07:38 +02:00
parent 128aa08be8
commit e73e13120e
@@ -1065,11 +1065,13 @@ static const struct wl_registry_listener registry_listener = {
static void fd_callback(int fd, struct wl_display *display) { static void fd_callback(int fd, struct wl_display *display) {
struct pollfd fds; struct pollfd fds = (struct pollfd) { fd, POLLIN, 0 };
fds.fd = fd; do {
fds.events = POLLIN; if (wl_display_dispatch(display) == -1) {
fds.revents = 0; Fl::fatal("Fatal error while communicating with the Wayland server: errno=%d\n",
do wl_display_dispatch(display); wl_display_get_error(display));
}
}
while (poll(&fds, 1, 0) > 0); while (poll(&fds, 1, 0) > 0);
} }