Filter Protocol Messages (Requests and Events).
The X protocol groups messages into four types: requests, replies, events, and errors. Requests are always sent by the client program
to the X server while replies, events, and errors are always sent from the X server to the client program. Here are some examples
to get a feel for what each type of message represents. The
Xlib function XDrawRectangle() generates the PolyRectangle request to tell the X server to draw a rectangle. Some requests expect the
X server to return information in the form of a reply. For example, the Xlib function XListFonts() generates the request ListFonts to the
X server which returns a reply to the client program with the information. A pointer click of the mouse or a key press on the keyboard are
examples of events that the server may send to the client program. If the client program tries to draw a rectangle on a nonexistent
window, the X server sends an error message to the client program. (The Links page contains
links to websites where you can go to get a complete description of how the X protocol works.)
Recording all X protocol in a running program can be quite large. If you're trying to debug a program, you may want to
"zoom in" to the where the program crashes by only recording the pertinent protocol elements. Xmsgtrace allows
you to quickly pick which requests and events to record. If a reply is associated with a selected request, the reply will be
recorded also. Any protocol errors are automatically recorded.