It needs modified Xstartup and Xreset scripts in the XDM configuration directory.
This voodoo is needed due to a problem with utmp logging with sessreg:
:0 cannot show up multiple times at once, but it would have to, because everything
before ":" is stripped.
So we replace :0 by @<hostname>. This makes the entry unique to the host.
Change the "-l"-argument of "sessreg" from "$DISPLAY" to "@${DISPLAY%:*}", so
sessreg -a -l $DISPLAY -u /var/run/utmp -x /etc/X11/kdm/Xservers $USERwould become
sessreg -a -l @${DISPLAY%:*} -u /var/run/utmp -x /etc/X11/kdm/Xservers $USERNote, that this modification drops the uniqueness of the display at a particular host. But in the normal case every host will have only one XDM-managed display.
If you have multiple displays on a host, then use "${DISPLAY#*:}@${DISPLAY%:*}" instead.