diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-06-27 19:40:08 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-06-27 19:40:08 +0200 |
| commit | 8dd7ab19220d06c0181fc422ea11d17ea97aa154 (patch) | |
| tree | 59ddd505181cd04e91a1ec87502c724e4d456247 /src | |
| parent | c2185f31b95af4feb6522ee821362acbb01bd374 (diff) | |
Fix for issue #450 : Fl_Counter slips into infinite loop (V2).
Need to poll only for the file descriptor associated to the wayland display.
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index dad143cb0..fbf27ad32 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -39,6 +39,7 @@ #include "text-input-client-protocol.h" #include <assert.h> #include <sys/mman.h> +#include <poll.h> extern "C" { bool libdecor_get_cursor_settings(char **theme, int *size); } @@ -1056,10 +1057,13 @@ static const struct wl_registry_listener registry_listener = { }; -static void fd_callback(int unused, struct wl_display *display) { - wl_display_dispatch(display); - static Fl_Wayland_System_Driver *sys_dr = (Fl_Wayland_System_Driver*)Fl::system_driver(); - while (sys_dr->poll_or_select() > 0) wl_display_dispatch(display); +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); + while (poll(&fds, 1, 0) > 0); } |
