diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-11-08 14:41:23 -0800 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-11-23 16:18:25 -0800 |
commit | 9b79ae49f709707e99b8487b01f9d3f102754bd3 (patch) | |
tree | 4b3a7c1aa4bd912a6f537bb1297fd8c46fa6cf8e | |
parent | 43b612a5e99ccdfb787a11b2b7c3179fc242edf3 (diff) |
Apple: Enable support for launchd DISPLAY socket
-rw-r--r-- | src/xcb_util.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c index 7c6a4dd..f5c9431 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -316,10 +316,18 @@ xcb_connection_t *xcb_connect(const char *displayname, int *screenp) xcb_connection_t *c; xcb_auth_info_t auth; +#ifdef __APPLE__ + if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11)) + fd = _xcb_open_unix(protocol, displayname); + else { +#endif if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp)) return (xcb_connection_t *) &error_connection; fd = _xcb_open(host, protocol, display); free(host); +#ifdef __APPLE__ + } +#endif if(fd == -1) return (xcb_connection_t *) &error_connection; @@ -340,10 +348,18 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, char *host; char *protocol; +#ifdef __APPLE__ + if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11)) + fd = _xcb_open_unix(protocol, displayname); + else { +#endif if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp)) return (xcb_connection_t *) &error_connection; fd = _xcb_open(host, protocol, display); free(host); +#ifdef __APPLE__ + } +#endif if(fd == -1) return (xcb_connection_t *) &error_connection; |