This code tried to automatically generate the X DISPLAY
from the combination of the hostname and display number;
however 127.0.0.1:0 is normally rejected by X11, so this
technique is no good. Fixes dticon hang on startup, caused by
XOpenDisplay failure leading to this message from tttrace:
tt_default_session_set(0x0x875190=="X 127.0.0.1 0") = 1032 (TT_ERR_ACCESS)
if (sscanf((char *)id, "X %s %d", host, &svnum) != 2) {
return(TT_ERR_SESSION);
}
+ /* We _cannot_ set _displayname based solely on host and svnum,
+ * because :0 is NOT the same as 127.0.0.1:0 as far as X11
+ * is concerned: by default, it will only accept connections
+ * to the former. (XOpenDisplay etc. will fail if you try the below!)
sprintf(dpname, "%s:%d", host, svnum);
_displayname = dpname;
+ */
+ if (! _displayname.len()) {
+ _displayname = _tt_global->xdisplayname;
+ }
+
_server_num = svnum;
_env = _TT_ENV_X11;
break;