<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 7:49 AM, Davide Bettio <span dir="ltr"><<a href="mailto:davide.bettio@ispirata.com" target="_blank">davide.bettio@ispirata.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Davide Bettio <<a href="mailto:davide.bettio@ispirata.com">davide.bettio@ispirata.com</a>><br>
---<br>
src/wayland-server.c | 17 ++++++++++-------<br>
1 file changed, 10 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/wayland-server.c b/src/wayland-server.c<br>
index 05e9c07..2922e41 100644<br>
--- a/src/wayland-server.c<br>
+++ b/src/wayland-server.c<br>
@@ -1093,9 +1093,12 @@ wl_socket_init_for_display_name(struct wl_socket *s, const char *name)<br>
int name_size;<br>
const char *runtime_dir;<br>
<br>
- runtime_dir = getenv("XDG_RUNTIME_DIR");<br>
+ runtime_dir = getenv("WAYLAND_SERVER_SOCKET_DIR");<br>
if (!runtime_dir) {<br>
- wl_log("error: XDG_RUNTIME_DIR not set in the environment\n");<br>
+ runtime_dir = getenv("XDG_RUNTIME_DIR");<br>
+ }<br>
+ if (!runtime_dir) {<br>
+ wl_log("error: XDG_RUNTIME_DIR or WAYLAND_SERVER_SOCKET_DIR not set in the environment\n");<br>
<br></blockquote><div><br></div><div>Won't this break wl_display_add_socket_auto when both variables are defined? i. e. socket will be created in WAYLAND_SERVER_SOCKET_DIR and<br></div><div>wl_display_add_socket_auto returns just a name of the socket, so the client will try to connect to XDG_RUNTIME_DIR/display_name. I suppose here is where you use absolute paths in you setup?<br><br></div><div>I like the absolute paths and on one side I like separating WAYLAND_DISPLAY for clients use only. On the other side if we use WAYLAND_DISPLAY for both, client and server, we just know that both will work with the right thing (which you don't want of course). Wouldn't absolute paths + patch for weston (set path where to create the socket + set correct WAYLAND_DISPLAY for childs) solve you're problem itself? When compositor is using wl_display_add_socket it just can create it where it wants (after the first patch of yours applied) and set right environment for clients to connect to it. What am I missing from you're use-case?<br><br>---------------------------------------------------------------------------------------<br></div><div>| weston |<br></div><div>| WAYLAND_DISPLAY=wayland-0 |<br>| |<br>| ---------------------------------------------------------------------------| |<br></div><div>| | nested weston --socket-path=somewhere/socket | |<br></div><div>| | WAYLAND_DISPLAY=somewhere/socket | |<br></div><div>| |--------------------------------------------------------------------------| |<br>| -------------------------------------------------------------------------------------|<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/* to prevent programs reporting<br>
* "failed to add socket: Success" */<br>
@@ -1220,14 +1223,14 @@ wl_display_add_socket_auto(struct wl_display *display)<br>
* and WAYLAND_DISPLAY env variable for the socket name. If WAYLAND_DISPLAY and<br>
* WAYLAND_SERVER_SOCKET are not set, then default wayland-0 is used.<br>
*<br>
- * The Unix socket will be created in the directory pointed to by environment<br>
- * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function<br>
- * fails and returns -1.<br>
+ * The Unix socket will be created in the directory pointed to by either environment<br>
+ * variable WAYLAND_SERVER_SOCKET_DIR or XDG_RUNTIME_DIR. If the none of the is set,<br>
+ * then this function fails and returns -1.<br>
*<br>
- * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the<br>
+ * The length of socket path, e.g., the path set in XDG_RUNTIME_DIR and the<br>
* socket name, must not exceed the maxium length of a Unix socket path.<br>
* The function also fails if the user do not have write permission in the<br>
- * XDG_RUNTIME_DIR path or if the socket name is already in use.<br>
+ * wayland socket path or if the socket name is already in use.<br>
*<br>
* \memberof wl_display<br>
*/<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div></div>