diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-09-25 17:31:45 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-09-28 10:59:54 +0200 |
commit | ce8a9c1b0156f1562ece70cb5d78d446fde02378 (patch) | |
tree | a80046abc7decacf34aba6a3e520ac4901613fa5 /src/plugins/platforms/cocoa | |
parent | 10780c7b8cd632087fb93005eaf03b6adf94a2b8 (diff) |
macOS: Propagate drawRect: dirty bounding rect as fallback
Change-Id: I333e2bfe4a25bfbfebef7b2ec30a600fd441c9a9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview_drawing.mm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm index 6f9c72513d..91c0a4dc07 100644 --- a/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -175,10 +175,8 @@ This method is called by AppKit for the non-layer case, where we are drawing into the NSWindow's surface. */ -- (void)drawRect:(NSRect)dirtyRect +- (void)drawRect:(NSRect)dirtyBoundingRect { - Q_UNUSED(dirtyRect); - Q_ASSERT_X(!self.layer, "QNSView", "The drawRect code path should not be hit when we are layer backed"); @@ -192,6 +190,9 @@ for (int i = 0; i < numDirtyRects; ++i) exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect(); + if (exposedRegion.isEmpty()) + exposedRegion = QRectF::fromCGRect(dirtyBoundingRect).toRect(); + qCDebug(lcQpaDrawing) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion; m_platformWindow->handleExposeEvent(exposedRegion); } |