The
XDisplayName()
function returns the name of the display that
XOpenDisplay()
would attempt to use.
If a NULL string is specified,
XDisplayName()
looks in the environment for the display and returns the display name that
XOpenDisplay()
would attempt to use.
This makes it easier to report to the user precisely which display the
program attempted to open when the initial connection attempt failed.