diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 94b5bb15c8..66a39274f2 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -1185,21 +1185,19 @@ void SceneOpenGL2::performPaintWindow(EffectWindowImpl* w, int mask, QRegion reg if (mask & PAINT_WINDOW_LANCZOS) { if (!m_lanczosFilter) { m_lanczosFilter = new LanczosFilter(this); - // recreate the lanczos filter when the screen gets resized - connect(screens(), SIGNAL(changed()), SLOT(resetLanczosFilter())); + // reset the lanczos filter when the screen gets resized + // it will get created next paint + connect(screens(), &Screens::changed, this, [this]() { + makeOpenGLContextCurrent(); + delete m_lanczosFilter; + m_lanczosFilter = NULL; + }); } m_lanczosFilter->performPaint(w, mask, region, data); } else w->sceneWindow()->performPaint(mask, region, data); } -void SceneOpenGL2::resetLanczosFilter() -{ - // TODO: Qt5 - replace by a lambda slot - delete m_lanczosFilter; - m_lanczosFilter = NULL; -} - //**************************************** // SceneOpenGL::Texture //**************************************** diff --git a/scene_opengl.h b/scene_opengl.h index 86360aca25..be09697f5d 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -141,9 +141,6 @@ protected: virtual void updateProjectionMatrix() override; void paintCursor() override; -private Q_SLOTS: - void resetLanczosFilter(); - private: void performPaintWindow(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data); QMatrix4x4 createProjectionMatrix() const;