mirror of
https://github.com/glfw/glfw.git
synced 2025-12-16 04:03:13 +00:00
Code cleanup and simplification
This commit is contained in:
parent
e917b77539
commit
6cdfa97ca5
@ -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]), ¬imeout))
|
ptimeout = ¬imeout; // 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]), ¬imeout))
|
if (!_glfwPollPOSIX(fds, sizeof(fds) / sizeof(fds[0]), ¬imeout))
|
||||||
{
|
{
|
||||||
@ -1462,7 +1456,6 @@ static void handleEvents(double* timeout)
|
|||||||
|
|
||||||
event = GLFW_TRUE;
|
event = GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user