Last change to non-XCB libX11 breaks KDE

Kean Johnston kean at
Tue Jul 17 08:24:23 PDT 2007

All (although specifically Alan since he committed the change),

The following thunk to libX11/src/ConnDis.c breaks KDE:
@@ -222,18 +225,25 @@

  #ifdef LOCALCONN
      /* check if phostname == localnodename AND protocol not specified */
-    if (!pprotocol && phostname && uname(&sys) >= 0 &&
+    if (!pprotocol && (!phostname || (phostname && uname(&sys) >= 0 &&
         !strncmp(phostname, sys.nodename,
         (strlen(sys.nodename) < strlen(phostname) ?
-       strlen(phostname) : strlen(sys.nodename))))
+        strlen(phostname) : strlen(sys.nodename))))))

When KDE starts up and does its weird DCOP madness and creates its
pipes, it uses XDisplayName(), which returns the value of $DISPLAY,
pretty much. As some later point after _X11TransConnectDisplay()
has been called, it again queries the display name, but not using
the XDisplayName() but rather (I am guessing) internal members of
the Display structure. The problem with this change is that if
DISPLAY was set to the (extremely common) ":0", then it gets
"canonicalized" by this change to "unix:0". Thus at two different
points in the life of the server you have two differnt strings for

I am sure this change wasn't arbitrary, so what was the original
problem trying to solve? I think we need to figure out a way of
solving it without changing the effective value of DISPLAY mid-stream.


More information about the xorg mailing list