XSync(display, discard)
      Display *display;
      Bool discard;


display Specifies the connection to the X server.
discard Specifies a Boolean value that indicates whether XSync() discards all events on the event queue.


The XSync() function flushes the output buffer and then waits until all requests have been received and processed by the X server. Any errors generated must be handled by the error handler. For each protocol error received by Xlib, XSync() calls the client application's error handling routine (see "Using the Default Error Handlers"). Any events generated by the server are enqueued into the library's event queue.

Finally, if you passed False, XSync() does not discard the events in the queue. If you passed True, XSync() discards all events in the queue, including those events that were on the queue before XSync() was called. Client applications seldom need to call XSync().

See also

XEventsQueued(), XFlush(), XPending(), "Handling the Output Buffer"
Christophe Tronche, ch@tronche.com