raster pushed a commit to branch efl-1.23.

http://git.enlightenment.org/core/efl.git/commit/?id=3670eee3aca3ea5e746c0d32c6c51068beac18a6

commit 3670eee3aca3ea5e746c0d32c6c51068beac18a6
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Oct 18 12:49:21 2019 +0100

    wl egl - use platform get display
    
    if possible, use the platform specific egl get display as a wl egl
    client. this fixes client side init with ... some drivers that can't
    auto-detect the display type passed in.
    
    @fix
---
 .../evas/engines/wayland_egl/evas_wl_main.c        | 23 +++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c 
b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index a5ae3f9f91..95e59ce9e2 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -46,16 +46,21 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int 
h, Render_Output_Swap
    context_attrs[1] = 2;
    context_attrs[2] = EGL_NONE;
 
-   /* FIXME: Remove this line as soon as eglGetDisplay() autodetection
-    * gets fixed. Currently it is incorrectly detecting wl_display and
-    * returning _EGL_PLATFORM_X11 instead of _EGL_PLATFORM_WAYLAND.
-    *
-    * See ticket #1972 for more info.
-    */
-
-   setenv("EGL_PLATFORM", "wayland", 1);
    wl_disp = ecore_wl2_display_get(gw->wl2_disp);
-   gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)wl_disp);
+   const char *s = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+   if (strstr(s, "EXT_platform_base"))
+     {
+        EGLDisplay (*func) (EGLenum platform, void *native_display, const 
EGLint *attrib_list);
+        func = (void *)eglGetProcAddress("eglGetPlatformDisplayEXT");
+        if (!func) goto noext;
+        gw->egl_disp = func(EGL_PLATFORM_WAYLAND_EXT, wl_disp, NULL);
+     }
+   else
+     {
+noext:
+        putenv("EGL_PLATFORM=wayland");
+        gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)wl_disp);
+     }
    if (!gw->egl_disp)
      {
         ERR("eglGetDisplay() fail. code=%#x", eglGetError());

-- 


Reply via email to