Supressed warning about typecast to XEvent *.
Added printf to several event cases.