From 3733abab2c5c3d7d769c23756e9472f3e7ac26c8 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 24 Mar 2022 14:55:14 +0100 Subject: [PATCH] scenes/opengl: Paint background with alpha 0 In conjunction with a buffer format with alpha channel this allows to have KWin's backdrop transparent to see through to a display layer below. Signed-off-by: Eike Hein --- src/scenes/opengl/scene_opengl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 5ef7623b03..1c3a1a5ab9 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -131,7 +131,7 @@ QMatrix4x4 SceneOpenGL::transformation(int mask, const ScreenPaintData &data) co void SceneOpenGL::paintBackground(const QRegion ®ion) { if (region == infiniteRegion()) { - glClearColor(0, 0, 0, 1); + glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); } else if (!region.isEmpty()) { QVector verts; @@ -294,7 +294,7 @@ void SceneOpenGL::doPaintBackground(const QVector< float >& vertices) { GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); vbo->reset(); - vbo->setUseColor(true); + vbo->setColor(QColor(0, 0, 0, 0)); vbo->setData(vertices.count() / 2, 2, vertices.data(), nullptr); ShaderBinder binder(ShaderTrait::UniformColor);