Use union for XEvents instead of casts.