Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Make sure the QOffscreenSurface is created in main thread as specified in the docs

parent e7a025dc
......@@ -124,6 +124,9 @@ GLWidget::GLWidget(int id, QObject *parent)
setClearBeforeRendering(false);
setResizeMode(QQuickView::SizeRootObjectToView);
m_offscreenSurface.setFormat(QWindow::format());
m_offscreenSurface.create();
m_monitorProfile = new Mlt::Profile();
m_refreshTimer.setSingleShot(true);
m_refreshTimer.setInterval(50);
......@@ -186,11 +189,7 @@ void GLWidget::updateAudioForAnalysis()
void GLWidget::initializeGL()
{
if (m_isInitialized || !isVisible() || (openglContext() == nullptr)) return;
if (!m_offscreenSurface.isValid()) {
m_offscreenSurface.setFormat(openglContext()->format());
m_offscreenSurface.create();
openglContext()->makeCurrent(this);
}
openglContext()->makeCurrent(&m_offscreenSurface);
initializeOpenGLFunctions();
qCDebug(KDENLIVE_LOG) << "OpenGL vendor: " << QString::fromUtf8((const char *)glGetString(GL_VENDOR));
qCDebug(KDENLIVE_LOG) << "OpenGL renderer: " << QString::fromUtf8((const char *)glGetString(GL_RENDERER));
......
Markdown is supported
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