summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-10-18 12:49:21 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-10-18 12:51:36 +0100
commitdb7348acf350c45ededa0899b58805a9c79b99e5 (patch)
tree5aec27f3fe2e2061ee09bbe75a74858f24ac96b8 /src/modules
parentc25ba58007d385e9eb20a42453caf89b250afc89 (diff)
downloadefl-db7348acf350c45ededa0899b58805a9c79b99e5.tar.gz
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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_wl_main.c23
1 files 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());