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 );