From 92c00d1dc395f605d99f27a1bca757a315cbc73e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 26 Jan 2021 02:56:21 +0100 Subject: [PATCH] screencasting: generate the composed textures with the proper size Don't neglect the scale of the buffer for windows that we are rendering on the spot. Otherwise we will be offering a smaller size to what we are generally using. More importantly, the ScreencastManager expects the buffers scaled. This causes glitches when the stream starts otherwise as the first frame triggers a resize. CCBUG: 428594 --- plugins/scenes/opengl/scene_opengl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index 115422bea0..3e6eb0fba7 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -1521,8 +1521,8 @@ QSharedPointer OpenGLWindow::windowTexture() return QSharedPointer(new GLTexture(*frame->texture())); } else { auto effectWindow = window()->effectWindow(); - const QRect geo = window()->clientGeometry(); - QSharedPointer texture(new GLTexture(GL_RGBA8, geo.size())); + const QRect geo = window()->bufferGeometry(); + QSharedPointer texture(new GLTexture(GL_RGBA8, geo.size() * window()->bufferScale())); QScopedPointer framebuffer(new KWin::GLRenderTarget(*texture)); GLRenderTarget::pushRenderTarget(framebuffer.data());