Code cleanup and simplification

This commit is contained in:
Doug Binks 2025-11-28 09:47:42 +00:00
parent e917b77539
commit 6cdfa97ca5

View File

@ -1406,16 +1406,12 @@ static void handleEvents(double* timeout)
return; return;
} }
if(event) double* ptimeout = timeout;
{ double notimeout = 0.0;
double notimeout = 0.0; if (event)
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), &notimeout)) ptimeout = &notimeout; // do not wait if we already have an event
{
wl_display_cancel_read(_glfw.wl.display); if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ptimeout))
return;
}
}
else if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), timeout))
{ {
wl_display_cancel_read(_glfw.wl.display); wl_display_cancel_read(_glfw.wl.display);
return; return;
@ -1433,8 +1429,6 @@ static void handleEvents(double* timeout)
else else
{ {
fds[DISPLAY_FD].fd = -1; // ignore wl events fds[DISPLAY_FD].fd = -1; // ignore wl events
//fds[LIBDECOR_FD].fd = -1;
//fds[CURSOR_FD].fd = -1;
double notimeout = 0.0; double notimeout = 0.0;
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), &notimeout)) if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), &notimeout))
{ {
@ -1462,7 +1456,6 @@ static void handleEvents(double* timeout)
event = GLFW_TRUE; event = GLFW_TRUE;
} }
} }
} }