devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=93f17dec584ccceea8ed5ca06ada22a89dc568b7

commit 93f17dec584ccceea8ed5ca06ada22a89dc568b7
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Tue Aug 18 15:55:24 2015 -0400

    ecore-wl2: Modify ecore_wl2_display_create to take an optional socket name
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/Ecore_Wl2.h         |  4 +++-
 src/lib/ecore_wl2/ecore_wl2_display.c | 22 +++++++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 123b43b..5c3d17e 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -106,11 +106,13 @@ EAPI int ecore_wl2_shutdown(void);
  * use with compositors, or to create a new display for use in nested
  * compositors.
  *
+ * @param name The display target name to create. If @c NULL, a default
+ *             display name will be assigned.
  * @return The newly created Ecore_Wl2_Display
  *
  * @ingroup Ecore_Wl2_Display_Group
  */
-EAPI Ecore_Wl2_Display *ecore_wl2_display_create(void);
+EAPI Ecore_Wl2_Display *ecore_wl2_display_create(const char *name);
 
 /**
  * Connect to an existing Wayland display
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c 
b/src/lib/ecore_wl2/ecore_wl2_display.c
index 7f1ace9..86981d6 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -151,7 +151,7 @@ _cb_globals_hash_del(void *data)
 }
 
 EAPI Ecore_Wl2_Display *
-ecore_wl2_display_create(void)
+ecore_wl2_display_create(const char *name)
 {
    Ecore_Wl2_Display *ewd;
    struct wl_event_loop *loop;
@@ -168,11 +168,23 @@ ecore_wl2_display_create(void)
         goto create_err;
      }
 
-   ewd->name = wl_display_add_socket_auto(ewd->wl.display);
-   if (!ewd->name)
+   if (!name)
      {
-        ERR("Failed to add display socket: %m");
-        goto socket_err;
+        ewd->name = wl_display_add_socket_auto(ewd->wl.display);
+        if (!ewd->name)
+          {
+             ERR("Failed to add display socket: %m");
+             goto socket_err;
+          }
+     }
+   else
+     {
+        ewd->name = strdup(name);
+        if (wl_display_add_socket(ewd->wl.display, name))
+          {
+             ERR("Failed to add display socket: %m");
+             goto socket_err;
+          }
      }
 
    loop = wl_display_get_event_loop(ewd->wl.display);

-- 


Reply via email to