From 37067f538ec071e8ab9637052410953973b7c864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 28 Oct 2016 11:44:57 +0200 Subject: [PATCH] Ensure the complete decoration texture gets repainted on recreation Summary: When the decoration size changes the textures get recreated and need to be properly filled. So far KWin used the scheduled repaint geometry in this situation. If the decoration didn't schedule the complete geometry for repain there will be an empty area in the decoration texture. This change ensures that the complete texture gets repainted when they are recreated. Thus the decoration rendering is more fault tolerant towards potential bugs in the decoration. With no-compositing and XRender compositing this problem was not reproducable and already fault tolerant, so OpenGL just catches up with the other modes. BUG: 371735 FIXED-IN: 5.8.3 Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3186 --- scene_opengl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index c8ce5db210..5e133820c5 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -2524,7 +2524,8 @@ void SceneOpenGLDecorationRenderer::render() if (scheduled.isEmpty()) { return; } - if (areImageSizesDirty()) { + const bool dirty = areImageSizesDirty(); + if (dirty) { resizeTexture(); resetImageSizesDirty(); } @@ -2537,7 +2538,7 @@ void SceneOpenGLDecorationRenderer::render() QRect left, top, right, bottom; client()->client()->layoutDecorationRects(left, top, right, bottom); - const QRect geometry = scheduled.boundingRect(); + const QRect geometry = dirty ? QRect(QPoint(0, 0), client()->client()->geometry().size()) : scheduled.boundingRect(); auto renderPart = [this](const QRect &geo, const QRect &partRect, const QPoint &offset, bool rotated = false) { if (geo.isNull()) {