1) Changed alarm message from "Timed out waiting for RandR outputs" to
"Timed out waiting for X display". The former was confusing, and the
times where this message was triggered were nothing to do with
RandR
2) Don't try to open a display of the form ":n" directory (n >= 0).
If the X server hasn't yet opened its local socket, the
XOpenDisplay() call can go to the network and possibly block
for a long time. Instead, use the (undocumented) "unix:n" display
specification, whih never goes to the network, and doesn't block.
Without this, the compilation of waitforx can fail on FreeBSD
with this error:-
waitforx.c:1:10: fatal error: 'X11/extensions/Xrandr.h' file not found
This PR makes the use of AM_CPPFLAGS and AM_CFLAGS the same as
that for (e.g.) chansrv which also depends on X includes
For some window managers (fvwm2 and fvwm3) if the X server isn't
running and has output it's possible for the window manager to fail or
reconfigure randr incorrectly.
With xrdp-waitfox:
- Install xrdp-waitfox to the BIN dir.
- sesman will run xrdp-waitfox as the logged in user.
- Set an alarm to exit after 30 seconds.
- Try to open env DISPLAY value's display (10 seconds).
- Test for RandR extension.
- Wait for outputs to appear (10 seconds).