X11: Make event polling more robust

This makes X11 event polling less likely to block if the application
uses the display via native access.

Fixes #1225.
master
Camilla Löwy ago%!(EXTRA string=7 years)
parent 15d89bdff6
commit 8d1a64c831
  1. 5
      src/x11_window.c

@ -2672,8 +2672,9 @@ void _glfwPlatformPollEvents(void)
#if defined(__linux__)
_glfwDetectJoystickConnectionLinux();
#endif
int count = XPending(_glfw.x11.display);
while (count--)
XPending(_glfw.x11.display);
while (XQLength(_glfw.x11.display))
{
XEvent event;
XNextEvent(_glfw.x11.display, &event);

Loading…
Cancel
Save