Fix for issue #450 : Fl_Counter slips into infinite loop (V2).

Need to poll only for the file descriptor associated to the wayland display.
This commit is contained in:
ManoloFLTK
2022-06-27 19:40:08 +02:00
parent c2185f31b9
commit 8dd7ab1922
@@ -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);
}