Add environment variable override helper function

This allows FORCE_QT_GLES and SEPARATE_TEST_DECODER to override both true and false.
This commit is contained in:
Cameron Gutman
2025-12-27 15:33:13 -06:00
parent 21fb2832e1
commit 41ad3c0938
9 changed files with 68 additions and 60 deletions

View File

@@ -550,9 +550,12 @@ int main(int argc, char *argv[])
#endif
}
if (WMUtils::isRunningNvidiaProprietaryDriverX11() ||
!WMUtils::supportsDesktopGLWithEGL() ||
qEnvironmentVariableIntValue("FORCE_QT_GLES")) {
bool forceGles;
if (!Utils::getEnvironmentVariableOverride("FORCE_QT_GLES", &forceGles)) {
forceGles = WMUtils::isRunningNvidiaProprietaryDriverX11() ||
!WMUtils::supportsDesktopGLWithEGL();
}
if (forceGles) {
// The Nvidia proprietary driver causes Qt to render a black window when using
// the default Desktop GL profile with EGL. AS a workaround, we default to
// OpenGL ES when running on Nvidia on X11.