1XFlush(3)                       XLIB FUNCTIONS                       XFlush(3)
2
3
4

NAME

6       XFlush,  XSync, XEventsQueued, XPending - handle output buffer or event
7       queue
8

SYNTAX

10       int XFlush(Display *display);
11
12       int XSync(Display *display, Bool discard);
13
14       int XEventsQueued(Display *display, int mode);
15
16       int XPending(Display *display);
17

ARGUMENTS

19       discard   Specifies a Boolean value that indicates whether  XSync  dis‐
20                 cards all events on the event queue.
21
22       display   Specifies the connection to the X server.
23
24       mode      Specifies the mode.  You can pass QueuedAlready, QueuedAfter‐
25                 Flush, or QueuedAfterReading.
26

DESCRIPTION

28       The XFlush function flushes the output buffer.   Most  client  applica‐
29       tions need not use this function because the output buffer is automati‐
30       cally flushed as needed by calls to XPending, XNextEvent, and  XWindow‐
31       Event.   Events  generated  by  the server may be enqueued into the li‐
32       brary's event queue.
33
34       The XSync function flushes the output buffer and then waits  until  all
35       requests  have been received and processed by the X server.  Any errors
36       generated must be handled by the error handler.  For each protocol  er‐
37       ror  received  by Xlib, XSync calls the client application's error han‐
38       dling routine (see section 11.8.2).  Any events generated by the server
39       are enqueued into the library's event queue.
40
41       Finally,  if you passed False, XSync does not discard the events in the
42       queue.  If you passed True, XSync discards all events in the queue, in‐
43       cluding  those  events  that were on the queue before XSync was called.
44       Client applications seldom need to call XSync.
45
46       If mode is QueuedAlready, XEventsQueued returns the  number  of  events
47       already in the event queue (and never performs a system call).  If mode
48       is QueuedAfterFlush, XEventsQueued returns the number of events already
49       in  the  queue if the number is nonzero.  If there are no events in the
50       queue, XEventsQueued flushes the output buffer, attempts to  read  more
51       events  out  of  the  application's  connection, and returns the number
52       read.  If mode is QueuedAfterReading, XEventsQueued returns the  number
53       of  events already in the queue if the number is nonzero.  If there are
54       no events in the queue, XEventsQueued attempts to read more events  out
55       of  the application's connection without flushing the output buffer and
56       returns the number read.
57
58       XEventsQueued always returns  immediately  without  I/O  if  there  are
59       events  already in the queue.  XEventsQueued with mode QueuedAfterFlush
60       is  identical  in  behavior  to  XPending.   XEventsQueued  with   mode
61       QueuedAlready is identical to the XQLength function.
62
63       The  XPending  function returns the number of events that have been re‐
64       ceived from the X server but have  not  been  removed  from  the  event
65       queue.    XPending   is   identical  to  XEventsQueued  with  the  mode
66       QueuedAfterFlush specified.
67

SEE ALSO

69       AllPlanes(3), XIfEvent(3), XNextEvent(3), XPutBackEvent(3)
70       Xlib - C Language X Interface
71
72
73
74X Version 11                    libX11 1.7.3.1                       XFlush(3)
Impressum