-sync with upstream, drop old xorg checks and removed cruft, and honor missing PCAT when PCATEGORY is defined