From e917b7753983f8ad9632ef8757b45e38c23a5274 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Wed, 26 Nov 2025 14:14:01 +0000 Subject: [PATCH] Ensure we attempt to read wl_display each frame Somewhat convoluted code needs reworking --- src/wl_window.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index c0ab5d8d6..0e6394fe2 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1381,6 +1381,10 @@ static void handleEvents(double* timeout) else if (wl_display_dispatch_pending(_glfw.wl.display) > 0) { event = GLFW_TRUE; + if (wl_display_prepare_read(_glfw.wl.display) == 0) + { + wlcanread = GLFW_TRUE; + } } } @@ -1402,7 +1406,16 @@ static void handleEvents(double* timeout) return; } - if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), timeout)) + if(event) + { + double notimeout = 0.0; + if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ¬imeout)) + { + wl_display_cancel_read(_glfw.wl.display); + return; + } + } + else if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), timeout)) { wl_display_cancel_read(_glfw.wl.display); return; @@ -1420,7 +1433,7 @@ static void handleEvents(double* timeout) else { fds[DISPLAY_FD].fd = -1; // ignore wl events - fds[LIBDECOR_FD].fd = -1; + //fds[LIBDECOR_FD].fd = -1; //fds[CURSOR_FD].fd = -1; double notimeout = 0.0; if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ¬imeout))