Eh, I've seen similar stuff in the Linux/UNIX world. Whenever different software components interact there's a chance you need some stupid stuff to get them to play nice. As some issues get fixed over time, new ones arrive since something gets swapped out for the next big thing. The interaction of X, the display manager, logind and dbus on session start comes to mind. There's been stupid stuff in Xsession.d et al over the years while these evolved.
xscreensaver also comes to mind; Jamie likes to keep all the legacy crap in the source code for operating systems and X extensions long gone, including rants about how they're broken under certain conditions, even if the bug is long fixed, just in case someone wants to compile the current version on their 1996 HPUX workstation.