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