summaryrefslogtreecommitdiff
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
parentc25ba58007d385e9eb20a42453caf89b250afc89 (diff)
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
-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 a5ae3f9..95e59ce 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
46 context_attrs[1] = 2; 46 context_attrs[1] = 2;
47 context_attrs[2] = EGL_NONE; 47 context_attrs[2] = EGL_NONE;
48 48
49 /* FIXME: Remove this line as soon as eglGetDisplay() autodetection
50 * gets fixed. Currently it is incorrectly detecting wl_display and
51 * returning _EGL_PLATFORM_X11 instead of _EGL_PLATFORM_WAYLAND.
52 *
53 * See ticket #1972 for more info.
54 */
55
56 setenv("EGL_PLATFORM", "wayland", 1);
57 wl_disp = ecore_wl2_display_get(gw->wl2_disp); 49 wl_disp = ecore_wl2_display_get(gw->wl2_disp);
58 gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)wl_disp); 50 const char *s = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
51 if (strstr(s, "EXT_platform_base"))
52 {
53 EGLDisplay (*func) (EGLenum platform, void *native_display, const EGLint *attrib_list);
54 func = (void *)eglGetProcAddress("eglGetPlatformDisplayEXT");
55 if (!func) goto noext;
56 gw->egl_disp = func(EGL_PLATFORM_WAYLAND_EXT, wl_disp, NULL);
57 }
58 else
59 {
60noext:
61 putenv("EGL_PLATFORM=wayland");
62 gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)wl_disp);
63 }
59 if (!gw->egl_disp) 64 if (!gw->egl_disp)
60 { 65 {
61 ERR("eglGetDisplay() fail. code=%#x", eglGetError()); 66 ERR("eglGetDisplay() fail. code=%#x", eglGetError());