From 33b8ab7d913c6db2f4b02ef95262302176443cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Thu, 11 Jun 2009 19:42:55 +0000 Subject: [PATCH] Really fix the crash on gwenview startup this time. Apparently a Toplevel isn't always a Client when the client rect is different from the toplevel rect. svn path=/trunk/KDE/kdebase/workspace/; revision=980458 --- scene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene.cpp b/scene.cpp index 20cb9cc66b..6205a351c6 100644 --- a/scene.cpp +++ b/scene.cpp @@ -480,9 +480,9 @@ WindowQuadList Scene::Window::buildQuads( bool force ) const ret = makeQuads( WindowQuadContents, shape()); // has no decoration else { - Client *client = static_cast( toplevel ); + Client *client = dynamic_cast( toplevel ); QRegion contents = clientShape(); - QRegion decoration = (Workspace::self()->decorationHasAlpha() ? + QRegion decoration = (client && Workspace::self()->decorationHasAlpha() ? QRegion(client->decorationRect()) : shape()) - contents; ret = makeQuads( WindowQuadContents, contents ); ret += makeQuads( WindowQuadDecoration, decoration );