From 945a0a87482dc24c5f12cdaaf1b3576549a4c8a5 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 30 Oct 2017 23:03:59 +0200 Subject: desktop-main.cpp: don't validate for custom backends Without this patch the user can pass a custom backend like 'software' and the validation will still be performed. In a case where the validation fails Subsurface will still exit. With this patch the validation is performed *only* for the standard backend which is OpenGL (or an empty QT_QUICK_BACKEND) env. variable. Signed-off-by: Lubomir I. Ivanov --- subsurface-desktop-main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'subsurface-desktop-main.cpp') diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp index d0b764e7b..e8f57ecff 100644 --- a/subsurface-desktop-main.cpp +++ b/subsurface-desktop-main.cpp @@ -140,6 +140,18 @@ bool haveFilesOnCommandLine() void validateGL() { + QString quickBackend = qgetenv("QT_QUICK_BACKEND"); + /* an empty QT_QUICK_BACKEND env. variable means OpenGL (default). + * only validate OpenGL; for everything else print out and return. + * https://doc.qt.io/qt-5/qtquick-visualcanvas-adaptations.html + */ + if (!quickBackend.isEmpty()) { + if (verbose) { + qDebug() << QStringLiteral(VALIDATE_GL_PREFIX "'QT_QUICK_BACKEND' is set to '%1'. " + "Skipping validation.").arg(quickBackend).toUtf8().data(); + } + return; + } GLint verMajor, verMinor; const char *glError = NULL; QOpenGLContext ctx; -- cgit v1.2.3-70-g09d2