summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-01-30 18:03:00 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-02-04 21:53:54 +0000
commit850c922036b7eebc24cdb74a43a4b31319d924c7 (patch)
tree1b0e987d6b3e5bb5f46568abe4202a8285a854e7
parent9435526d507611b8b54f7c65df9febdde193c7bf (diff)
macOS: Don't deliver update requests for windows that need display
If a window needs display due to e.g. being resized, we need to wait until the corresponding expose event has been delivered before we resume update requests, otherwise the update requests may result in partial paints that do not fully cover the area needing display. Change-Id: Ibfb54bfe3c2e85b606ef67d34a6a5fdb85456edd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index b0f0d51ecb..a1bed3db45 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1487,6 +1487,17 @@ void QCocoaWindow::requestUpdate()
void QCocoaWindow::deliverUpdateRequest()
{
+ // Don't send update requests for views that need display, as the update
+ // request doesn't carry any information about dirty rects, so the app
+ // may end up painting a smaller region than required. (For some reason
+ // the layer and view's needsDisplay status isn't always in sync, even if
+ // the view is layer-backed, not layer-hosted, so we check both).
+ if (m_view.layer.needsDisplay || m_view.needsDisplay) {
+ qCDebug(lcQpaDrawing) << "View needs display, deferring update request for" << window();
+ requestUpdate();
+ return;
+ }
+
qCDebug(lcQpaDrawing) << "Delivering update request to" << window();
QPlatformWindow::deliverUpdateRequest();
}