diff --git a/src/plugins/screencast/outputscreencastsource.cpp b/src/plugins/screencast/outputscreencastsource.cpp index c0a56b7524..806e529701 100644 --- a/src/plugins/screencast/outputscreencastsource.cpp +++ b/src/plugins/screencast/outputscreencastsource.cpp @@ -53,7 +53,7 @@ void OutputScreenCastSource::render(GLFramebuffer *target) ShaderBinder shaderBinder(ShaderTrait::MapTexture); QMatrix4x4 projectionMatrix; - projectionMatrix.ortho(geometry); + projectionMatrix.ortho(scaledRect(geometry, m_output->scale())); shaderBinder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, projectionMatrix); GLFramebuffer::pushFramebuffer(target); diff --git a/src/plugins/screencast/regionscreencastsource.cpp b/src/plugins/screencast/regionscreencastsource.cpp index fc5fe34461..cd4bd92a6a 100644 --- a/src/plugins/screencast/regionscreencastsource.cpp +++ b/src/plugins/screencast/regionscreencastsource.cpp @@ -58,7 +58,7 @@ void RegionScreenCastSource::updateOutput(Output *output) projectionMatrix.ortho(m_region); const QPoint pos = outputGeometry.topLeft(); - projectionMatrix.translate(pos.x(), pos.y()); + projectionMatrix.translate(pos.x() * outputScale, pos.y() * outputScale); shaderBinder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, projectionMatrix); diff --git a/src/plugins/screencast/windowscreencastsource.cpp b/src/plugins/screencast/windowscreencastsource.cpp index 080ad57a4d..5c85b4e911 100644 --- a/src/plugins/screencast/windowscreencastsource.cpp +++ b/src/plugins/screencast/windowscreencastsource.cpp @@ -50,7 +50,9 @@ void WindowScreenCastSource::render(QImage *image) void WindowScreenCastSource::render(GLFramebuffer *target) { - const QRectF geometry = m_window->clientGeometry(); + auto targetScale = Compositor::self()->scene()->renderTargetScale(); + + const QRectF geometry = scaledRect(m_window->clientGeometry(), targetScale); QMatrix4x4 projectionMatrix; projectionMatrix.ortho(geometry.x(), geometry.x() + geometry.width(), geometry.y(), geometry.y() + geometry.height(), -1, 1);