mirror of https://github.com/fltk/fltk
Check for error while communicating with Wayland.
This commit is contained in:
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) {
|
||||
struct pollfd fds;
|
||||
fds.fd = fd;
|
||||
fds.events = POLLIN;
|
||||
fds.revents = 0;
|
||||
do wl_display_dispatch(display);
|
||||
struct pollfd fds = (struct pollfd) { fd, POLLIN, 0 };
|
||||
do {
|
||||
if (wl_display_dispatch(display) == -1) {
|
||||
Fl::fatal("Fatal error while communicating with the Wayland server: errno=%d\n",
|
||||
wl_display_get_error(display));
|
||||
}
|
||||
}
|
||||
while (poll(&fds, 1, 0) > 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue