mirror of
https://github.com/glfw/glfw.git
synced 2025-12-16 20:23:13 +00:00
Ensure we attempt to read wl_display each frame
Somewhat convoluted code needs reworking
This commit is contained in:
parent
78c2e851b0
commit
e917b77539
@ -1381,6 +1381,10 @@ static void handleEvents(double* timeout)
|
|||||||
else if (wl_display_dispatch_pending(_glfw.wl.display) > 0)
|
else if (wl_display_dispatch_pending(_glfw.wl.display) > 0)
|
||||||
{
|
{
|
||||||
event = GLFW_TRUE;
|
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;
|
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);
|
wl_display_cancel_read(_glfw.wl.display);
|
||||||
return;
|
return;
|
||||||
@ -1420,7 +1433,7 @@ 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[LIBDECOR_FD].fd = -1;
|
||||||
//fds[CURSOR_FD].fd = -1;
|
//fds[CURSOR_FD].fd = -1;
|
||||||
double notimeout = 0.0;
|
double notimeout = 0.0;
|
||||||
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ¬imeout))
|
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ¬imeout))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user