diff --git configure.ac configure.ac
index 4f748ca..6b77aea 100644
|
|
elif test x$dbus_win = xyes; then |
1811 | 1811 | # branch of the conditional because the default might conceivably |
1812 | 1812 | # change (see #38201) |
1813 | 1813 | DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:" |
| 1814 | elif test x$dbus_darwin = xyes; then |
| 1815 | # Mac OS X autolaunching is a bit different too |
| 1816 | # in that it relies on launchd |
| 1817 | DBUS_SESSION_BUS_CONNECT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET" |
1814 | 1818 | else |
1815 | 1819 | # The default on all other Unix platforms (notably Linux) |
1816 | | # is to use auto-launching - this works a bit differently on Mac OS X |
1817 | | # but comes out basically the same in the end |
| 1820 | # is to use auto-launching. |
1818 | 1821 | DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:" |
1819 | 1822 | fi |
1820 | 1823 | AC_SUBST([DBUS_SESSION_BUS_CONNECT_ADDRESS]) |
diff --git dbus/dbus-server-unix.c dbus/dbus-server-unix.c
index 92664a8..2ef949c 100644
|
|
_dbus_server_listen_platform_specific (DBusAddressEntry *entry, |
262 | 262 | const char *launchd_env_var = dbus_address_entry_get_value (entry, "env"); |
263 | 263 | if (launchd_env_var == NULL) |
264 | 264 | { |
| 265 | #if 0 |
265 | 266 | _dbus_set_bad_address (error, "launchd", "env", NULL); |
266 | 267 | return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; |
| 268 | #endif |
267 | 269 | } |
268 | | *server_p = _dbus_server_new_for_launchd (launchd_env_var, error); |
269 | | |
270 | | if (*server_p != NULL) |
271 | | { |
272 | | _DBUS_ASSERT_ERROR_IS_CLEAR(error); |
273 | | return DBUS_SERVER_LISTEN_OK; |
274 | | } |
275 | | else |
| 270 | if (launchd_env_var) |
276 | 271 | { |
277 | | _DBUS_ASSERT_ERROR_IS_SET(error); |
278 | | return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; |
| 272 | *server_p = _dbus_server_new_for_launchd (launchd_env_var, error); |
| 273 | |
| 274 | if (*server_p != NULL) |
| 275 | { |
| 276 | _DBUS_ASSERT_ERROR_IS_CLEAR(error); |
| 277 | return DBUS_SERVER_LISTEN_OK; |
| 278 | } |
| 279 | #if 0 |
| 280 | else |
| 281 | { |
| 282 | _DBUS_ASSERT_ERROR_IS_SET(error); |
| 283 | return DBUS_SERVER_LISTEN_DID_NOT_CONNECT; |
| 284 | } |
| 285 | #endif |
279 | 286 | } |
280 | | } |
| 287 | // try a hardcoded traditional address as a fallback |
| 288 | { |
| 289 | DBusAddressEntry **altEntry; |
| 290 | int altLen; |
| 291 | DBusServerListenResult retval; |
| 292 | if (dbus_parse_address ("unix:tmpdir="DBUS_SESSION_SOCKET_DIR, &altEntry, &altLen, error) && altLen > 0) |
| 293 | { |
| 294 | retval = _dbus_server_listen_platform_specific (altEntry[0], server_p, error); |
| 295 | dbus_address_entries_free (altEntry); |
| 296 | } |
| 297 | else |
| 298 | { |
| 299 | retval = DBUS_SERVER_LISTEN_DID_NOT_CONNECT; |
| 300 | } |
| 301 | return retval; |
| 302 | } |
281 | 303 | #endif |
| 304 | } |
282 | 305 | else |
283 | 306 | { |
284 | 307 | /* If we don't handle the method, we return NULL with the |
diff --git dbus/dbus-sysdeps-unix.c dbus/dbus-sysdeps-unix.c
index 5691c5a..4e76ca5 100644
|
|
_dbus_lookup_session_address (dbus_bool_t *supported, |
4130 | 4130 | { |
4131 | 4131 | #ifdef DBUS_ENABLE_LAUNCHD |
4132 | 4132 | *supported = TRUE; |
4133 | | return _dbus_lookup_session_address_launchd (address, error); |
4134 | | #else |
| 4133 | if (_dbus_lookup_session_address_launchd (address, error)) |
| 4134 | { |
| 4135 | // success, no need to attempt anything else |
| 4136 | return TRUE; |
| 4137 | } |
| 4138 | // dbus can function without launchd like it does on other Unix versions, even when |
| 4139 | // it will use launchd by default (on Mac). So there is no need to disable the |
| 4140 | // non-launchd code path below. |
| 4141 | #endif |
4135 | 4142 | *supported = FALSE; |
4136 | 4143 | |
4137 | 4144 | if (!_dbus_lookup_user_bus (supported, address, error)) |
4138 | 4145 | return FALSE; |
4139 | | else if (*supported) |
| 4146 | #ifdef DBUS_ENABLE_LAUNCHD |
| 4147 | { |
| 4148 | const char *c = _dbus_string_get_const_data (address); |
| 4149 | _dbus_verbose ("traditional session bus lookup yielded address \"%s\"", |
| 4150 | c ? c : "NULL"); |
| 4151 | } |
| 4152 | #endif |
| 4153 | if (*supported) |
4140 | 4154 | return TRUE; |
4141 | 4155 | |
4142 | | /* On non-Mac Unix platforms, if the session address isn't already |
| 4156 | /* On Unix platforms, if the session address isn't already |
4143 | 4157 | * set in DBUS_SESSION_BUS_ADDRESS environment variable and the |
4144 | 4158 | * $XDG_RUNTIME_DIR/bus can't be used, we punt and fall back to the |
4145 | 4159 | * autolaunch: global default; see init_session_address in |
4146 | 4160 | * dbus/dbus-bus.c. */ |
4147 | 4161 | return TRUE; |
4148 | | #endif |
4149 | 4162 | } |
4150 | 4163 | |
4151 | 4164 | /** |
diff --git tools/dbus-launch-x11.c tools/dbus-launch-x11.c
index a09444b..d79b4a7 100644
|
|
x11_get_address (char **paddress, pid_t *pid, long *wid) |
305 | 305 | |
306 | 306 | /* locate the selection owner */ |
307 | 307 | owner = XGetSelectionOwner (xdisplay, selection_atom); |
308 | | if (owner == None) |
309 | | return TRUE; /* no owner */ |
310 | 308 | if (wid != NULL) |
311 | 309 | *wid = (long) owner; |
| 310 | if (owner == None) |
| 311 | return TRUE; /* no owner */ |
312 | 312 | |
313 | 313 | /* get the bus address */ |
314 | 314 | result = XGetWindowProperty (xdisplay, owner, address_atom, 0, 1024, False, |