11.3 Event Queue Management
Xlib maintains an event queue.
However, the operating system also may be buffering data
in its network connection that is not yet read into the event queue.
To check the number of events in the event queue, use
XEventsQueued().
To return the number of events that are pending, use
XPending().
Christophe Tronche, ch@tronche.com