+ int fd, display = 0;
+ char *host;
+ char *protocol;
+ xcb_auth_info_t ourauth;
+ xcb_connection_t *c;
+
+ int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
+
+#ifdef HAVE_LAUNCHD
+ if(!displayname)
+ displayname = getenv("DISPLAY");
+ if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11))
+ fd = _xcb_open_unix(NULL, displayname);
+ else
+#endif
+ if(!parsed)
+ return (xcb_connection_t *) &error_connection;
+ else
+ fd = _xcb_open(host, protocol, display);
+ free(host);
+
+ if(fd == -1)
+ return (xcb_connection_t *) &error_connection;
+
+ if(auth)
+ return xcb_connect_to_fd(fd, auth);
+
+ if(_xcb_get_auth_info(fd, &ourauth, display))