diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-08-05 12:09:13 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-08-05 12:09:13 +0200 |
| commit | 2953db58c75f30912bee6b91fd5ff087bbb8cad5 (patch) | |
| tree | b5b2d5a1b010df6c4a0291d2c9088bf2bff6effb /src | |
| parent | 157d27606fc8881e637428f211aae8f3b0d27754 (diff) | |
Let FLTK give more detailed description of a Wayland fatal error
Wayland protocol error messages now give the protocol name and the error code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
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); |
