Deep copy the shadow pixmaps

At least with NVIDIA drivers we get bad alloc errors in glXCreatePixmap
for the shared pixmaps.
This commit is contained in:
Martin Gräßlin 2011-03-30 20:29:54 +02:00
parent 12220a0d59
commit bd12134f05

View file

@ -83,7 +83,8 @@ QVector< long > Shadow::readX11ShadowProperty(WId id)
void Shadow::init(const QVector< long > &data) void Shadow::init(const QVector< long > &data)
{ {
for (int i=0; i<ShadowElementsCount; ++i) { for (int i=0; i<ShadowElementsCount; ++i) {
m_shadowElements[i] = QPixmap::fromX11Pixmap(data[i]); QPixmap pix = QPixmap::fromX11Pixmap(data[i]);
m_shadowElements[i] = pix.copy(0, 0, pix.width(), pix.height());
} }
m_topOffset = data[ShadowElementsCount]; m_topOffset = data[ShadowElementsCount];
m_rightOffset = data[ShadowElementsCount+1]; m_rightOffset = data[ShadowElementsCount+1];