From 044767e29655b84f229ee16f0882acd5e757cab9 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 19 Nov 2021 07:22:32 +0000 Subject: [PATCH] Speed up EffectQuickView teardown On my Nvidia machine there was a massive lag exitingthe overview effect. Hotspot showed it as being in QOpenGLVertexArrayObjectPrivate::destroy. In this method we clean up some shared objects used in the context when the context closes. In order to do this we need the context to be current. If it is not current Qt currently internally creates a temporary offscreen surface. To fix this we need to have our context current during destruction, which includes changing order so it is destroyed before the surface. --- src/libkwineffects/kwineffectquickview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libkwineffects/kwineffectquickview.cpp b/src/libkwineffects/kwineffectquickview.cpp index ca5a025729..954c028838 100644 --- a/src/libkwineffects/kwineffectquickview.cpp +++ b/src/libkwineffects/kwineffectquickview.cpp @@ -57,8 +57,8 @@ class Q_DECL_HIDDEN EffectQuickView::Private public: QQuickWindow *m_view; QQuickRenderControl *m_renderControl; - QScopedPointer m_glcontext; QScopedPointer m_offscreenSurface; + QScopedPointer m_glcontext; QScopedPointer m_fbo; QTimer *m_repaintTimer; @@ -165,7 +165,6 @@ EffectQuickView::~EffectQuickView() delete d->m_view; d->m_view = nullptr; d->m_renderControl->invalidate(); - d->m_glcontext->doneCurrent(); } }