glXGetCurrentDisplay returns client-side information. It does not make a round trip to the server, and therefore does not flush any pending events.