From 1ca5e439c12ba4d1ac90032a4033d8be72d3960d Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sun, 3 Jan 2021 23:38:50 -0500 Subject: [PATCH] [client] egl: disable EGL when running on Wayland This commit makes Looking Glass always use the OpenGL renderer when running on Wayland. The EGL renderer is broken on Wayland and can't reasonably be fixed until SDL is dropped entirely (as per https://github.com/gnif/LookingGlass/issues/306). Until that time, the OpenGL renderer provides a much better Wayland-native experience. --- client/renderers/EGL/egl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index 4816ddbf..a4b00a97 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -170,6 +170,13 @@ void egl_setup() bool egl_create(void ** opaque, const LG_RendererParams params) { + // Fail if running on Wayland so that OpenGL is used instead. Wayland-EGL + // is broken (https://github.com/gnif/LookingGlass/issues/306) and isn't + // fixable until SDL is dropped entirely. Until then, the OpenGL renderer + // "mostly works". + if (getenv("WAYLAND_DISPLAY")) + return false; + // check if EGL is even available if (!eglQueryString(EGL_NO_DISPLAY, EGL_VERSION)) return false;