[PATH wayland] allow clients to connect to a socket located on a different dir than XDG_RUNTIME_DIR

Jon A. Cruz jonc at osg.samsung.com
Fri Feb 6 15:33:31 PST 2015


Looks good  (however I did hit some odd formatting error with the patch
file itself)

Reviewed-by: Jon A. Cruz <jonc at osg.samsung.com>


On 02/05/2015 08:42 AM, Bettio, Davide wrote:
> commit 1ebae6d4f27ff0d336f2df0b8821099d2b2e510e
> Author: Davide Bettio <davide.bettio at ispirata.com>
> Date:   Thu Feb 5 17:04:42 2015 +0100
> 
>     Added support to optionally use WAYLAND_CLIENT_SERVER_SOCKET_DIR
> instead of XDG_DIR.
> 
>     WAYLAND_CLIENT_SERVER_SOCKET_DIR should not to be confused with
> WAYLAND_SERVER_SOCKET_DIR.
>     WAYLAND_CLIENT_SERVER_SOCKET_DIR is used by wayland client
> applications to connect
>     to a server socket which is located on a different path.
>     By using two different env vars it makes possible to specify a
> different directory
>     for the nested server socked in case of nested compositors.
> 
>     Signed-off-by: Davide Bettio <davide.bettio at ispirata.com>
> 
> diff --git a/src/wayland-client.c b/src/wayland-client.c
> index b0f77b9..81ba69b 100644
> --- a/src/wayland-client.c
> +++ b/src/wayland-client.c
> @@ -700,9 +700,12 @@ connect_to_socket(const char *name)
>      const char *runtime_dir;
>      int name_size, fd;
> 
> -    runtime_dir = getenv("XDG_RUNTIME_DIR");
> +    runtime_dir = getenv("WAYLAND_CLIENT_SERVER_SOCKET_DIR");
>      if (!runtime_dir) {
> -        wl_log("error: XDG_RUNTIME_DIR not set in the environment.\n");
> +        runtime_dir = getenv("XDG_RUNTIME_DIR");
> +        }
> +    if (!runtime_dir) {
> +        wl_log("error: either XDG_RUNTIME_DIR or
> WAYLAND_CLIENT_SERVER_SOCKET_DIR are not set in the environment.\n");
>          /* to prevent programs reporting
>           * "failed to create display: Success" */
>          errno = ENOENT;
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel

-- 
Jon A. Cruz - Senior Open Source Developer
Samsung Open Source Group
jonc at osg.samsung.com


More information about the wayland-devel mailing list