Spotted by @Luflosi.
@ -2776,6 +2776,7 @@ void _glfwPlatformPollEvents(void)
_GLFWwindow* window;
#if defined(__linux__)
if (_glfw.joysticksInitialized)
_glfwDetectJoystickConnectionLinux();
#endif
XPending(_glfw.x11.display);