Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 447862
Collapse All | Expand All

(-)plasma/generic/applets/systemtray/protocols/fdo/x11embedcontainer.cpp (-5 / +6 lines)
Lines 194-201 Link Here
194
194
195
    // Taking a detour via a QPixmap is unfortunately the only way we can get
195
    // Taking a detour via a QPixmap is unfortunately the only way we can get
196
    // the window contents into Qt's backing store.
196
    // the window contents into Qt's backing store.
197
    QPixmap pixmap(size());
197
    QPixmap pixmap = toX11Pixmap(QPixmap(size()));
198
    pixmap = toX11Pixmap(pixmap);
199
    pixmap.fill(Qt::transparent);
198
    pixmap.fill(Qt::transparent);
200
    XRenderComposite(x11Info().display(), PictOpSrc, d->picture, None, pixmap.x11PictureHandle(),
199
    XRenderComposite(x11Info().display(), PictOpSrc, d->picture, None, pixmap.x11PictureHandle(),
201
                     0, 0, 0, 0, 0, 0, width(), height());
200
                     0, 0, 0, 0, 0, 0, width(), height());
Lines 234-247 Link Here
234
{
233
{
235
    if(pix.handle() != 0)   // X11 pixmap
234
    if(pix.handle() != 0)   // X11 pixmap
236
        return pix;
235
        return pix;
236
    QPixmap ret;
237
    Pixmap xpix = XCreatePixmap(pix.x11Info().display(), RootWindow(pix.x11Info().display(), pix.x11Info().screen()),
237
    Pixmap xpix = XCreatePixmap(pix.x11Info().display(), RootWindow(pix.x11Info().display(), pix.x11Info().screen()),
238
                                pix.width(), pix.height(), QX11Info::appDepth());
238
                                pix.width(), pix.height(), QX11Info::appDepth());
239
    QPixmap wrk = QPixmap::fromX11Pixmap(xpix);
239
    {
240
        QPixmap wrk = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
240
    QPainter paint(&wrk);
241
    QPainter paint(&wrk);
241
    paint.drawPixmap(0, 0, pix);
242
    paint.drawPixmap(0, 0, pix);
242
    paint.end();
243
    paint.end();
243
    QPixmap ret = wrk.copy();
244
        ret = wrk.copy();
244
    wrk = QPixmap(); // reset, so that xpix can be freed (QPixmap does not own it)
245
    } // free resources so that xpix can be freed (QPixmap does not own it)
245
    XFreePixmap(pix.x11Info().display(), xpix);
246
    XFreePixmap(pix.x11Info().display(), xpix);
246
    return ret;
247
    return ret;
247
}
248
}

Return to bug 447862