Commit 17db7d75 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

opengl source: Do not crash if we could not make our context current

BUG: 449505
parent edda2a6c
Pipeline #133056 passed with stage
in 3 minutes and 23 seconds
......@@ -13,6 +13,7 @@
#include <QOpenGLFunctions>
#include <QSurfaceFormat>
#include <QWindow>
#include "logging_p.h"
using namespace KUserFeedback;
......@@ -37,7 +38,11 @@ QVariant OpenGLInfoSource::data()
QWindow window;
if (!context.makeCurrent(&window)) {
qCWarning(Log) << "Could not make OpenGL context current";
m.insert(QStringLiteral("type"), QStringLiteral("none"));
return m;
QOpenGLFunctions functions(&context);
m.insert(QStringLiteral("vendor"), OpenGLInfoSourcePrivate::normalizeVendor(reinterpret_cast<const char*>(functions.glGetString(GL_VENDOR))));
m.insert(QStringLiteral("renderer"), OpenGLInfoSourcePrivate::normalizeRenderer(reinterpret_cast<const char*>(functions.glGetString(GL_RENDERER))));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment