shadow: reduce X11 code