Merge remote-tracking branch 'iysheng/glfw'

This commit is contained in:
Reece Wilson 2023-11-05 15:05:54 +00:00
commit 2bfe4fc182

View File

@ -392,6 +392,7 @@ void _glfwTerminateJoysticksLinux(void)
GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
{
// Read all queued events (non-blocking)
GLFWbool event_valid = GLFW_FALSE;
for (;;)
{
struct input_event e;
@ -402,6 +403,8 @@ GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
// Reset the joystick slot if the device was disconnected
if (errno == ENODEV)
closeJoystick(js);
else if ((errno == EAGAIN) && (mode != _GLFW_POLL_PRESENCE))
return event_valid;
break;
}
@ -413,6 +416,7 @@ GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode)
else if (e.code == SYN_REPORT)
{
_glfw.linjs.dropped = GLFW_FALSE;
event_valid = GLFW_TRUE;
pollAbsState(js);
}
}