Set window's surface format to support alpha channel.
authorGatis Paeglis <gatis.paeglis@nokia.com>
Tue, 26 Jun 2012 17:14:45 +0000 (19:14 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 28 Jun 2012 04:22:00 +0000 (06:22 +0200)
Task-number: QTBUG-26114
Change-Id: I33f191373327832fb9d3054366412ec5be855cff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
src/platformsupport/dnd/qshapedpixmapdndwindow.cpp
src/plugins/platforms/xcb/qxcbdrag.cpp

index 4eed1e7..95ceb0d 100644 (file)
@@ -50,6 +50,9 @@ QShapedPixmapWindow::QShapedPixmapWindow()
     : QWindow(),
       m_backingStore(0)
 {
+    QSurfaceFormat format;
+    format.setAlphaBufferSize(8);
+    setFormat(format);
     setSurfaceType(RasterSurface);
     setWindowFlags(Qt::ToolTip | Qt::FramelessWindowHint |
                    Qt::X11BypassWindowManagerHint | Qt::WindowTransparentForInput);
@@ -67,6 +70,7 @@ void QShapedPixmapWindow::render()
 
     {
         QPainter p(device);
+        p.setCompositionMode(QPainter::CompositionMode_Source);
         p.drawPixmap(0, 0, m_pixmap);
     }
 
index 3299180..176d1bb 100644 (file)
@@ -465,7 +465,6 @@ void QXcbDrag::move(const QMouseEvent *me)
         move.window = target;
         move.format = 32;
         move.type = atom(QXcbAtom::XdndPosition);
-        move.window = target;
         move.data.data32[0] = connection()->clipboard()->owner();
         move.data.data32[1] = 0; // flags
         move.data.data32[2] = (globalPos.x() << 16) + globalPos.y();