summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-08-06 17:05:30 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-08-07 12:20:52 +0000
commitbedf50a5bb9656a64ec609536366f90929a63c39 (patch)
tree4cc19006f0fd0a522f3bb10a405b7203d4bd6848 /src/plugins/platforms/cocoa
parent3068b185c5684c6e2175b047095b5ad80a6cbbac (diff)
macOS: Don't blend the backingstore unless the window has a background
If there's no background, we should copy the backingstore, so that the backingstore is not blended with the result of the previous flush. The unified toolbar case is covered by the window having a textured background. Task-number: QTBUG-69773 Change-Id: I2f4eed9f44a60ebe7495ce68cf5a54d3d2424b0c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 091453785e..1343fbc45a 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -162,13 +162,13 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPo
const qreal devicePixelRatio = m_image.devicePixelRatio();
- // If the flushed window is a content view, and not in unified toolbar mode,
- // and is fully opaque, we can get away with copying the backingstore instead
- // of blending.
+ // If the flushed window is a content view, and we're filling the drawn area
+ // completely, or it doesn't have a window background we need to preserve,
+ // we can get away with copying instead of blending the backing store.
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
const NSCompositingOperation compositingOperation = cocoaWindow->isContentView()
- && cocoaWindow->isOpaque() && !windowHasUnifiedToolbar() ?
- NSCompositingOperationCopy : NSCompositingOperationSourceOver;
+ && (cocoaWindow->isOpaque() || view.window.backgroundColor == NSColor.clearColor)
+ ? NSCompositingOperationCopy : NSCompositingOperationSourceOver;
#ifdef QT_DEBUG
static bool debugBackingStoreFlush = [[NSUserDefaults standardUserDefaults]