diff --git a/src/plugins/screencast/screencaststream.cpp b/src/plugins/screencast/screencaststream.cpp index bffab3866f..32e501e779 100644 --- a/src/plugins/screencast/screencaststream.cpp +++ b/src/plugins/screencast/screencaststream.cpp @@ -276,7 +276,7 @@ ScreenCastStream::ScreenCastStream(ScreenCastSource *source, std::shared_ptr(now - m_lastSent.value()); if (lastSentAgo < frameInterval) { - m_pendingDamages += damagedRegion; + m_pendingDamage += damage; m_pendingContents |= contents; if (!m_pendingFrame.isActive()) { m_pendingFrame.start(frameInterval - lastSentAgo); @@ -435,7 +434,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion, Contents conte } } - m_pendingDamages = {}; + m_pendingDamage = {}; m_pendingContents = {}; struct pw_buffer *pwBuffer = pw_stream_dequeue_buffer(m_pwStream); @@ -473,13 +472,14 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion, Contents conte } } + QRegion effectiveDamage = damage; if (effectiveContents & Content::Cursor) { Cursor *cursor = Cursors::self()->currentCursor(); switch (m_cursor.mode) { case ScreencastV1Interface::Hidden: break; case ScreencastV1Interface::Embedded: - damagedRegion += addCursorEmbedded(buffer, cursor); + effectiveDamage += addCursorEmbedded(buffer, cursor); break; case ScreencastV1Interface::Metadata: addCursorMetadata(spa_buffer, cursor); @@ -494,7 +494,7 @@ void ScreenCastStream::recordFrame(const QRegion &_damagedRegion, Contents conte glFlush(); } - addDamage(spa_buffer, damagedRegion); + addDamage(spa_buffer, effectiveDamage); addHeader(spa_buffer); if (effectiveContents & Content::Video) { diff --git a/src/plugins/screencast/screencaststream.h b/src/plugins/screencast/screencaststream.h index 261700e18c..e341acb933 100644 --- a/src/plugins/screencast/screencaststream.h +++ b/src/plugins/screencast/screencaststream.h @@ -66,11 +66,7 @@ public: void close(); - /** - * Renders @p frame into the current framebuffer into the stream - * @p timestamp - */ - void recordFrame(const QRegion &damagedRegion, Contents contents = Content::Video); + void recordFrame(const QRegion &damage, Contents contents = Content::Video); void setCursorMode(ScreencastV1Interface::CursorMode mode, qreal scale, const QRectF &viewport); @@ -140,7 +136,7 @@ private: quint32 m_drmFormat = 0; std::optional m_lastSent; - QRegion m_pendingDamages; + QRegion m_pendingDamage; QTimer m_pendingFrame; Contents m_pendingContents = Content::None; };