From 6f1b36d3b46bc6699b8635d3233236fcdd90c036 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 31 Jan 2023 13:29:49 +0100 Subject: [PATCH] plugins/screencast: make context current later, don't make it current twice --- src/plugins/screencast/screencaststream.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp index 3b7d7054a5..c7efd12882 100644 --- a/src/plugins/screencast/screencaststream.cpp +++ b/src/plugins/screencast/screencaststream.cpp @@ -354,9 +354,6 @@ bool ScreenCastStream::createStream() if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded) { connect(Cursors::self(), &Cursors::positionChanged, this, [this] { - if (auto scene = Compositor::self()->scene()) { - scene->makeOpenGLContextCurrent(); - } recordFrame({}); }); } else if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) { @@ -379,7 +376,6 @@ void ScreenCastStream::stop() void ScreenCastStream::recordFrame(const QRegion &_damagedRegion) { - static_cast(Compositor::self()->backend())->makeCurrent(); QRegion damagedRegion = _damagedRegion; Q_ASSERT(!m_stopped); @@ -428,6 +424,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion) } spa_data->chunk->offset = 0; + static_cast(Compositor::self()->backend())->makeCurrent(); if (data || spa_data[0].type == SPA_DATA_MemFd) { const bool hasAlpha = m_source->hasAlphaChannel(); const int bpp = data && !hasAlpha ? 3 : 4;