ecore_wl2: connect to default display
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Mon, 16 May 2016 10:14:40 +0000 (19:14 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 16 May 2016 10:14:40 +0000 (19:14 +0900)
Summary: if there is no env var AND no name, connection to wayland-0

Reviewers: raster, jpeg, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3945

src/lib/ecore_wl2/ecore_wl2_display.c

index 2b007ca..7770d3b 100644 (file)
@@ -636,6 +636,10 @@ ecore_wl2_display_connect(const char *name)
      {
         /* client wants to connect to default display */
         n = getenv("WAYLAND_DISPLAY");
+
+        if (!n)
+          n = "wayland-0";
+
         if (n)
           {
              /* we have a default wayland display */
@@ -654,12 +658,6 @@ ecore_wl2_display_connect(const char *name)
         if (ewd) goto found;
      }
 
-   if ((!name) && (!n))
-     {
-        ERR("No Wayland Display Running");
-        goto name_err;
-     }
-
    /* allocate space for display structure */
    ewd = calloc(1, sizeof(Ecore_Wl2_Display));
    if (!ewd) return NULL;