shadow: consolidate X11 subsystem code