From 6f5f999c54ff62ea7e9fa724b93f344a70870a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 2 Jun 2013 16:53:56 +0200 Subject: [PATCH] catch NULL client pointer BUG: 320589 FIXED-IN: 4.11 REVIEW: 110782 --- scene.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scene.cpp b/scene.cpp index 2231bcff7c..6ed85dc1ec 100644 --- a/scene.cpp +++ b/scene.cpp @@ -748,15 +748,20 @@ WindowQuadList Scene::Window::buildQuads(bool force) const ret = makeQuads(WindowQuadContents, contents); QRect rects[4]; - client->layoutDecorationRects(rects[0], rects[1], rects[2], rects[3], Client::WindowRelative); + bool isShadedClient = false; - if (!client || !(center.isEmpty() || client->isShade())) - ret += makeDecorationQuads(rects, decoration); - else { - // this is a shaded client, we have to create four decoration quads + if (client) { + client->layoutDecorationRects(rects[0], rects[1], rects[2], rects[3], Client::WindowRelative); + isShadedClient = client->isShade() || center.isEmpty(); + } + + if (isShadedClient) { const QRect bounding = rects[0] | rects[1] | rects[2] | rects[3]; ret += makeDecorationQuads(rects, bounding); + } else { + ret += makeDecorationQuads(rects, decoration); } + } if (m_shadow) { ret << m_shadow->shadowQuads();