1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

mp_session: Always use global displayname

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)
This commit is contained in:
Frederic Koehler 2012-08-14 21:49:14 -04:00 committed by Jon Trulson
parent e8ff159737
commit 66e428596b

View file

@ -793,8 +793,17 @@ set_id(char *id)
if (sscanf((char *)id, "X %s %d", host, &svnum) != 2) { if (sscanf((char *)id, "X %s %d", host, &svnum) != 2) {
return(TT_ERR_SESSION); 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); sprintf(dpname, "%s:%d", host, svnum);
_displayname = dpname; _displayname = dpname;
*/
if (! _displayname.len()) {
_displayname = _tt_global->xdisplayname;
}
_server_num = svnum; _server_num = svnum;
_env = _TT_ENV_X11; _env = _TT_ENV_X11;
break; break;