diff --git a/src/backends/virtual/virtual_backend.cpp b/src/backends/virtual/virtual_backend.cpp index d0757e9bf8..7dd4332438 100644 --- a/src/backends/virtual/virtual_backend.cpp +++ b/src/backends/virtual/virtual_backend.cpp @@ -11,8 +11,6 @@ #include "virtual_egl_backend.h" #include "virtual_output.h" #include "virtual_qpainter_backend.h" -// Qt -#include namespace KWin { @@ -20,15 +18,6 @@ namespace KWin VirtualBackend::VirtualBackend(QObject *parent) : OutputBackend(parent) { - if (qEnvironmentVariableIsSet("KWIN_WAYLAND_VIRTUAL_SCREENSHOTS")) { - m_screenshotDir.reset(new QTemporaryDir); - if (!m_screenshotDir->isValid()) { - m_screenshotDir.reset(); - } - if (m_screenshotDir) { - qDebug() << "Screenshots saved to: " << m_screenshotDir->path(); - } - } } VirtualBackend::~VirtualBackend() @@ -43,14 +32,6 @@ bool VirtualBackend::initialize() return true; } -QString VirtualBackend::screenshotDirPath() const -{ - if (!m_screenshotDir) { - return QString(); - } - return m_screenshotDir->path(); -} - std::unique_ptr VirtualBackend::createQPainterBackend() { return std::make_unique(this); diff --git a/src/backends/virtual/virtual_backend.h b/src/backends/virtual/virtual_backend.h index c62ddaf3da..4feb6555b1 100644 --- a/src/backends/virtual/virtual_backend.h +++ b/src/backends/virtual/virtual_backend.h @@ -15,8 +15,6 @@ #include #include -class QTemporaryDir; - namespace KWin { class VirtualBackend; @@ -32,12 +30,6 @@ public: bool initialize() override; - bool saveFrames() const - { - return m_screenshotDir != nullptr; - } - QString screenshotDirPath() const; - std::unique_ptr createQPainterBackend() override; std::unique_ptr createOpenGLBackend() override; @@ -59,7 +51,6 @@ private: VirtualOutput *createOutput(const QPoint &position, const QSize &size, qreal scale); QVector m_outputs; - std::unique_ptr m_screenshotDir; }; } // namespace KWin diff --git a/src/backends/virtual/virtual_egl_backend.cpp b/src/backends/virtual/virtual_egl_backend.cpp index 2bc8f244ff..7c882caaa8 100644 --- a/src/backends/virtual/virtual_egl_backend.cpp +++ b/src/backends/virtual/virtual_egl_backend.cpp @@ -201,11 +201,6 @@ void VirtualEglBackend::present(Output *output) glFlush(); static_cast(output)->vsyncMonitor()->arm(); - - if (m_backend->saveFrames()) { - const std::unique_ptr &layer = m_outputs[output]; - layer->texture()->toImage().save(QStringLiteral("%1/%2-%3.png").arg(m_backend->screenshotDirPath(), output->name(), QString::number(m_frameCounter++))); - } } } // namespace diff --git a/src/backends/virtual/virtual_egl_backend.h b/src/backends/virtual/virtual_egl_backend.h index 0a199c8aa9..cd34d2e388 100644 --- a/src/backends/virtual/virtual_egl_backend.h +++ b/src/backends/virtual/virtual_egl_backend.h @@ -61,7 +61,6 @@ private: void removeOutput(Output *output); VirtualBackend *m_backend; - int m_frameCounter = 0; std::map> m_outputs; }; diff --git a/src/backends/virtual/virtual_qpainter_backend.cpp b/src/backends/virtual/virtual_qpainter_backend.cpp index 0be6550b86..b26d37f38d 100644 --- a/src/backends/virtual/virtual_qpainter_backend.cpp +++ b/src/backends/virtual/virtual_qpainter_backend.cpp @@ -42,8 +42,6 @@ QImage *VirtualQPainterLayer::image() } VirtualQPainterBackend::VirtualQPainterBackend(VirtualBackend *backend) - : QPainterBackend() - , m_backend(backend) { connect(backend, &VirtualBackend::outputAdded, this, &VirtualQPainterBackend::addOutput); connect(backend, &VirtualBackend::outputRemoved, this, &VirtualQPainterBackend::removeOutput); @@ -69,10 +67,6 @@ void VirtualQPainterBackend::removeOutput(Output *output) void VirtualQPainterBackend::present(Output *output) { static_cast(output)->vsyncMonitor()->arm(); - - if (m_backend->saveFrames()) { - m_outputs[output]->image()->save(QStringLiteral("%1/%2-%3.png").arg(m_backend->screenshotDirPath(), output->name(), QString::number(m_frameCounter++))); - } } VirtualQPainterLayer *VirtualQPainterBackend::primaryLayer(Output *output) diff --git a/src/backends/virtual/virtual_qpainter_backend.h b/src/backends/virtual/virtual_qpainter_backend.h index 01d4341bdb..51d5d443d6 100644 --- a/src/backends/virtual/virtual_qpainter_backend.h +++ b/src/backends/virtual/virtual_qpainter_backend.h @@ -50,8 +50,6 @@ private: void removeOutput(Output *output); std::map> m_outputs; - VirtualBackend *m_backend; - int m_frameCounter = 0; }; } // namespace KWin