devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=ab6add8375c92b2ca0c3a142e084a0d1bc561d5b

commit ab6add8375c92b2ca0c3a142e084a0d1bc561d5b
Author: Chris Michael <[email protected]>
Date:   Mon Oct 13 15:48:53 2014 -0400

    e-comp-wl: Support wl_display_add_socket_auto function
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/bin/e_comp_wl.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 0c87951..eb18084 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1646,7 +1646,7 @@ _e_comp_wl_compositor_create(void)
 {
    E_Comp *comp;
    E_Comp_Data *cdata;
-   char buff[PATH_MAX];
+   const char *name;
    /* char *rules, *model, *layout; */
    int fd = 0;
 
@@ -1664,10 +1664,6 @@ _e_comp_wl_compositor_create(void)
    cdata = E_NEW(E_Comp_Data, 1);
    comp->wl_comp_data = cdata;
 
-   /* setup wayland display environment variable */
-   snprintf(buff, sizeof(buff), "%s/wayland-0", e_ipc_socket);
-   e_env_set("WAYLAND_DISPLAY", buff);
-
    /* try to create wayland display */
    if (!(cdata->wl.disp = wl_display_create()))
      {
@@ -1675,12 +1671,15 @@ _e_comp_wl_compositor_create(void)
         goto disp_err;
      }
 
-   if (wl_display_add_socket(cdata->wl.disp, buff))
+   if (!(name = wl_display_add_socket_auto(cdata->wl.disp)))
      {
         ERR("Could not create a Wayland Display: %m");
         goto disp_err;
      }
 
+   /* setup wayland display environment variable */
+   e_env_set("WAYLAND_DISPLAY", name);
+
    /* setup wayland compositor signals */
    wl_signal_init(&cdata->signals.surface.create);
    wl_signal_init(&cdata->signals.surface.activate);

-- 


Reply via email to