From 2953db58c75f30912bee6b91fd5ff087bbb8cad5 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 5 Aug 2023 12:09:13 +0200 Subject: Let FLTK give more detailed description of a Wayland fatal error Wayland protocol error messages now give the protocol name and the error code. --- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index de7bd92c9..0df7ab07b 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -1169,8 +1169,15 @@ static void wayland_socket_callback(int fd, struct wl_display *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: %s", - strerror(errno)); + int err = wl_display_get_error(display); + if (err == EPROTO) { + const struct wl_interface *interface; + int code = wl_display_get_protocol_error(display, &interface, NULL); + Fl::fatal("Fatal error no %d in Wayland protocol: %s", code, interface->name); + } else { + Fl::fatal("Fatal error while communicating with the Wayland server: %s", + strerror(errno)); + } } } while (poll(&fds, 1, 0) > 0); -- cgit v1.2.3