Fix joystick callback when it's already connected on app start

This commit is contained in:
Felipe Jorge 2025-07-15 09:45:20 -03:00
parent d11cb3779b
commit ee38126be5

View File

@ -1261,11 +1261,8 @@ GLFWAPI void* glfwGetJoystickUserPointer(int jid)
GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun) GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun)
{ {
_GLFW_REQUIRE_INIT_OR_RETURN(NULL); _GLFW_REQUIRE_INIT_OR_RETURN(NULL);
if (!initJoysticks())
return NULL;
_GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun); _GLFW_SWAP(GLFWjoystickfun, _glfw.callbacks.joystick, cbfun);
initJoysticks();
return cbfun; return cbfun;
} }