From 653d59af04326bf987c32623e86225a97f4c72d7 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 10 May 2011 22:28:13 +0100 Subject: [PATCH] Explicitly set EGL_PLATFORM=wayland for wayland winsys The EGL API doesn't provide for a way to explicitly select a platform when the driver can support multiple. Mesa allows selection using an EGL_PLATFORM environment variable though so we set that to "wayland" when we know that's what we want. --- cogl/winsys/cogl-winsys-egl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c index 2533d690a..aeae9822d 100644 --- a/cogl/winsys/cogl-winsys-egl.c +++ b/cogl/winsys/cogl-winsys-egl.c @@ -363,6 +363,12 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer, #elif defined (COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT) + /* The EGL API doesn't provide for a way to explicitly select a + * platform when the driver can support multiple. Mesa allows + * selection using an environment variable though so that's what + * we're doing here... */ + setenv("EGL_PLATFORM", "wayland", 1); + if (renderer->foreign_wayland_display) { egl_renderer->wayland_display = renderer->foreign_wayland_display;