Skip to content
  • Aaron Plattner's avatar
    XOpenDisplay: save the correct display_name value · f92e7542
    Aaron Plattner authored
    
    
    The X Test Suite's XDisplayString test checks the invariant
    XDisplayString(XOpenDisplay(str)) == str.  The Xlib XOpenDisplay violates this
    invariant by expanding str to the canonical form "host:display.scrn" (unless
    HAVE_LAUNCHD is set and it starts with "/tmp/launch").  E.g., this expands ":1"
    to ":1.0":
    
      400|26 1 1 19:26:41|IC Start
      200|26 1 19:26:41|TP Start
      520|26 1 00032625 1 1|VSW5TESTSUITE PURPOSE 1
      520|26 1 00032625 1 2|Assertion XDisplayString-1.(A)
      520|26 1 00032625 1 3|A call to XDisplayString returns the string that was used
      520|26 1 00032625 1 4|as the argument to the XOpenDisplay call that returned the
      520|26 1 00032625 1 5|value used as the display argument.
      520|26 1 00032625 1 6|METH: Open a connection using XOpenDisplay.
      520|26 1 00032625 1 7|METH: Obtain the display string using XDisplayString.
      520|26 1 00032625 1 8|METH: Verify that the value of the string is the parameter used in XOpenDisplay.
      520|26 1 00032625 1 9|METH: Close the display using XCloseDisplay.
      520|26 1 00032625 1 10|REPORT: XDisplayString() returned ":1.0" instead of ":1".
      220|26 1 1 19:26:41|FAIL
      410|26 1 1 19:26:41|IC End
    
    Fix this by deleting all of the code to construct the canonical path and just
    stashing a copy of the original display_name in dpy->display_name.
    
    Signed-off-by: Aaron Plattner's avatarAaron Plattner <aplattner@nvidia.com>
    Reviewed-by: default avatarJeremy Huddleston <jeremyhu@apple.com>
    f92e7542