diff --git a/shadow.cpp b/shadow.cpp index 422313e1e6..5f3fa4de56 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -52,7 +52,10 @@ Shadow *Shadow::createShadow(Toplevel *toplevel) #endif } if (shadow) { - shadow->init(data); + if (!shadow->init(data)) { + delete shadow; + return NULL; + } } return shadow; } else { @@ -80,10 +83,13 @@ QVector< long > Shadow::readX11ShadowProperty(WId id) return ret; } -void Shadow::init(const QVector< long > &data) +bool Shadow::init(const QVector< long > &data) { for (int i=0; i &data) const QRect leftRect(- m_leftOffset, - m_topOffset, m_leftOffset, m_topLevel->height() + m_topOffset + m_bottomOffset); m_shadowRegion = QRegion(topRect).united(rightRect).united(bottomRect).united(leftRect); buildQuads(); + return true; } void Shadow::buildQuads() diff --git a/shadow.h b/shadow.h index 6b4719ed57..eb2009f610 100644 --- a/shadow.h +++ b/shadow.h @@ -124,7 +124,7 @@ protected: private: static QVector readX11ShadowProperty(WId id); - void init(const QVector &data); + bool init(const QVector &data); Toplevel *m_topLevel; // shadow pixmaps QPixmap m_shadowElements[ShadowElementsCount];