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:
parent
e8ff159737
commit
66e428596b
1 changed files with 9 additions and 0 deletions
|
@ -793,8 +793,17 @@ set_id(char *id)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue