I was watching a presentation on Weyland and I wondered about how to see X events as they happen, I seem to recall doing this many years ago supporting customers but have not had a reason to do it recently.
Looking into this, it should be possible with xev.
xev allows you to monitor an existing window, however I wanted to watch events when a program starts up, e.g. possibly diagnose a slow starting application which you suspect to be caused by X.
I believe this can be done by getting xev to monitor you root window (putting it in the background) and then launching the application that you wish to monitor, e.g.
xev -r &
<graphical application>