On Tue, 3 Mar 2015 13:49:54 +0100 Davide Bettio <davide.bet...@ispirata.com> wrote:
> Signed-off-by: Davide Bettio <davide.bet...@ispirata.com> > --- > src/wayland-server.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/src/wayland-server.c b/src/wayland-server.c > index eefbe35..05e9c07 100644 > --- a/src/wayland-server.c > +++ b/src/wayland-server.c > @@ -1216,9 +1216,9 @@ wl_display_add_socket_auto(struct wl_display *display) > * This adds a Unix socket to Wayland display which can be used by clients to > * connect to Wayland display. > * > - * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env > - * variable for the socket name. If WAYLAND_DISPLAY is not set, then default > - * wayland-0 is used. > + * If NULL is passed as name, then it would look in order for > WAYLAND_SERVER_SOCKET > + * and WAYLAND_DISPLAY env variable for the socket name. If WAYLAND_DISPLAY > and > + * WAYLAND_SERVER_SOCKET are not set, then default wayland-0 is used. > * > * The Unix socket will be created in the directory pointed to by environment > * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this > function > @@ -1241,6 +1241,8 @@ wl_display_add_socket(struct wl_display *display, const > char *name) > return -1; > > if (name == NULL) > + name = getenv("WAYLAND_SERVER_SOCKET"); > + if (name == NULL) > name = getenv("WAYLAND_DISPLAY"); > if (name == NULL) > name = "wayland-0"; Hi Davide, there is no longer a need to play with these environment variables trying to contort libwayland-server to create a socket like you want it. http://cgit.freedesktop.org/wayland/wayland/commit/?id=225830dcb8bf1a6583d0f4ca182584024783923e "server: Add a socket with an existing fd" You can create the socket any way you want, and have libwayland-server start answering connections on it. Mind, that nested Wayland or mini-compositor setups are better off creating the connection with socketpair(2) and using WAYLAND_SOCKET environment variable per client process, because then you control exactly which processes can be connected. Thanks, pq
pgpdSYx9q_pjR.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel