plugins/screencast: make context current later, don't make it current twice

(cherry picked from commit 6f1b36d3b46bc6699b8635d3233236fcdd90c036)
icc-effect-5.27.2
Xaver Hugl 2023-01-31 13:29:49 +01:00 committed by Vlad Zahorodnii
parent 1c8456890c
commit a3bf413a0f
1 changed files with 1 additions and 4 deletions

View File

@ -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<OpenGLBackend *>(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<OpenGLBackend *>(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;