Fix rendering glitch in screenshot effect with Raster

We have to set the bit depth of the XPixmap to 32 in order to get
an alpha channel and we have to render the grabbed image using
composition mode Source in order to just copy all pixels to the
destination pixmap.

BUG: 276719
FIXED-IN: 4.7.0
This commit is contained in:
Martin Gräßlin 2011-07-03 12:23:11 +02:00
parent 5c0d24c7bf
commit 78dd6e6859

View file

@ -118,9 +118,10 @@ void ScreenShotEffect::postPaintScreen()
m_lastScreenshot = QPixmap::fromImage(img);
if (m_lastScreenshot.handle() == 0) {
Pixmap xpix = XCreatePixmap(display(), rootWindow(), m_lastScreenshot.width(),
m_lastScreenshot.height(), XDefaultDepth(display(), QX11Info::appScreen()));
m_lastScreenshot.height(), 32);
m_lastScreenshot = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
QPainter p(&m_lastScreenshot);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.drawImage(QPoint(0, 0), img);
}
emit screenshotCreated(m_lastScreenshot.handle());