[PATCH wayland 1/2] support specifying custom directories for the client and server

Imran Zaman imran.zaman at gmail.com
Wed Oct 15 07:33:38 PDT 2014


Hi

support specifying custom directories for the client and server
sockets through environment           variables.

This is in order to support nested compositor architectures where
system compositor using drm-backend is shared among multiple child
compositors using wayland-backend.
---


diff --git a/src/wayland-client.c b/src/wayland-client.c
index 1229b5f..428af68 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -700,7 +700,9 @@ 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_DIR");
+ if (runtime_dir == NULL)
+ runtime_dir = getenv("XDG_RUNTIME_DIR");
  if (!runtime_dir) {
  wl_log("error: XDG_RUNTIME_DIR not set in the environment.\n");
  /* to prevent programs reporting
diff --git a/src/wayland-server.c b/src/wayland-server.c
index e3b7d9f..ce1eca8 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -1080,7 +1080,9 @@ wl_socket_init_for_display_name(struct wl_socket
*s, const char *name)
  int name_size;
  const char *runtime_dir;

- runtime_dir = getenv("XDG_RUNTIME_DIR");
+ runtime_dir = getenv("WAYLAND_SERVER_DIR");
+ if (runtime_dir == NULL)
+ runtime_dir = getenv("XDG_RUNTIME_DIR");
  if (!runtime_dir) {
  wl_log("error: XDG_RUNTIME_DIR not set in the environment\n");


More information about the wayland-devel mailing list