diff --git a/abstract_egl_backend.cpp b/abstract_egl_backend.cpp index 3e6f0c8820..9f2d5fbdac 100644 --- a/abstract_egl_backend.cpp +++ b/abstract_egl_backend.cpp @@ -176,6 +176,9 @@ void AbstractEglBackend::doneCurrent() bool AbstractEglBackend::isOpenGLES() const { + if (qstrcmp(qgetenv("KWIN_COMPOSE"), "O2ES") == 0) { + return true; + } return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES; } diff --git a/compositingprefs.cpp b/compositingprefs.cpp index 4d32ad40fc..bb83d45a42 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -85,6 +85,8 @@ bool CompositingPrefs::compositingPossible() #endif if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) { return true; + } else if (qstrcmp(qgetenv("KWIN_COMPOSE"), "O2ES") == 0) { + return true; } qCDebug(KWIN_CORE) << "No OpenGL or XRender/XFixes support"; return false; diff --git a/options.cpp b/options.cpp index d7332f22c6..b73e792a14 100644 --- a/options.cpp +++ b/options.cpp @@ -772,6 +772,9 @@ void Options::setGlPlatformInterface(OpenGLPlatformInterface interface) if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) { qCDebug(KWIN_CORE) << "Forcing EGL native interface as Qt uses OpenGL ES"; interface = EglPlatformInterface; + } else if (qstrcmp(qgetenv("KWIN_COMPOSE"), "O2ES") == 0) { + qCDebug(KWIN_CORE) << "Forcing EGL native interface as OpenGL ES requested through KWIN_COMPOSE environment variable."; + interface = EglPlatformInterface; } if (m_glPlatformInterface == interface) { diff --git a/plugins/qpa/abstractplatformcontext.cpp b/plugins/qpa/abstractplatformcontext.cpp index 4cda66dca1..3ddca9c4e2 100644 --- a/plugins/qpa/abstractplatformcontext.cpp +++ b/plugins/qpa/abstractplatformcontext.cpp @@ -28,6 +28,9 @@ namespace QPA static bool isOpenGLES() { + if (qstrcmp(qgetenv("KWIN_COMPOSE"), "O2ES") == 0) { + return true; + } return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES; } diff --git a/scene_opengl.cpp b/scene_opengl.cpp index d276194adb..413995494b 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -951,7 +951,7 @@ bool SceneOpenGL2::supported(OpenGLBackend *backend) { const QByteArray forceEnv = qgetenv("KWIN_COMPOSE"); if (!forceEnv.isEmpty()) { - if (qstrcmp(forceEnv, "O2") == 0) { + if (qstrcmp(forceEnv, "O2") == 0 || qstrcmp(forceEnv, "O2ES") == 0) { qCDebug(KWIN_CORE) << "OpenGL 2 compositing enforced by environment variable"; return true; } else {