Merge X server block handling code paths

Use the new X server API as the reference system and emulate it on
the older API. Avoids a lot of code duplication.
6 files changed