Cocoa: Make QMacNativeWidget paint correctly
QWindows with transparent pixels (of which QMacNativeWidget is an example) must be composited, even if they are content views. This will display the NSWindow background instead of solid black for the areas where the Qt backingstore has transparent pixels. Change-Id: Ibee1327e11bc64975900b4c5d632dd5f103da4c8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
dbdd5f0ffb
commit
306df144b4
@ -163,9 +163,11 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo
|
||||
const qreal devicePixelRatio = m_image.devicePixelRatio();
|
||||
|
||||
// If the flushed window is a content view, and not in unified toolbar mode,
|
||||
// we can get away with copying the backingstore instead of blending.
|
||||
const NSCompositingOperation compositingOperation = static_cast<QCocoaWindow *>(
|
||||
window->handle())->isContentView() && !windowHasUnifiedToolbar() ?
|
||||
// and is fully opaque, we can get away with copying the backingstore instead
|
||||
// of blending.
|
||||
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
||||
const NSCompositingOperation compositingOperation = cocoaWindow->isContentView()
|
||||
&& cocoaWindow->isOpaque() && !windowHasUnifiedToolbar() ?
|
||||
NSCompositingOperationCopy : NSCompositingOperationSourceOver;
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user