Event & X11 fixes