From 1ea0625ca8762787097d33a4acaf3830d7ee104c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 10 May 2023 11:26:51 +0200 Subject: [PATCH] macOS: Replace [QNSView drawRect:] assert with warning AppKit will in some cases call this method, even if we are layer backed, just because we implement it. We should remove the implementation, but doing so requires us to also move from displayLayer to updateLayer for the layer backed drawing, which requires more testing. Pick-to: 6.5 Fixes: QTBUG-113500 Change-Id: I70bde34fdb433105d85ccea0514a5342e2c1e725 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qnsview_drawing.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm index 472a5291e7..77fa8259ac 100644 --- a/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -178,8 +178,10 @@ - (void)drawRect:(NSRect)dirtyBoundingRect { Q_UNUSED(dirtyBoundingRect); - Q_ASSERT_X(!self.layer, "QNSView", - "The drawRect code path should not be hit when we are layer backed"); + // As we are layer backed we shouldn't really end up here, but AppKit will + // in some cases call this method just because we implement it. + // FIXME: Remove drawRect and switch from displayLayer to updateLayer + qCWarning(lcQpaDrawing) << "[QNSView drawRect] called for layer backed view"; } /*