mirror of
https://github.com/fltk/fltk.git
synced 2026-05-25 09:17:49 +08:00
Check for error while communicating with Wayland.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user