From 78dd6e6859d3b4925d8c421b95744d8eb3d48de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 3 Jul 2011 12:23:11 +0200 Subject: [PATCH] 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 --- effects/screenshot/screenshot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index 029cbc357e..e1704b48ef 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -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());