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

remotes/origin/work/zzag/p6-drop-legacy-shortcut-in-night-color
Xaver Hugl 3 years ago committed by Vlad Zahorodnii
parent abd59be232
commit 6f1b36d3b4
  1. 5
      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<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;

Loading…
Cancel
Save