move X11 code to *_X11 files