What strace is for system calls, x11trace is for X11 connections:
you hook it between one or more X11 clients and an X server and
it prints the requests going from client to server and the replies,
events and errors going the other way.
|x11trace||trace communication between X11 client and server|