macOS: Propagate drawRect: dirty bounding rect as fallback
Change-Id: I333e2bfe4a25bfbfebef7b2ec30a600fd441c9a9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>bb10
parent
10780c7b8c
commit
ce8a9c1b01
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue