From b80262055c0624f3b22277ee1c0101dd4c56d12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 18 Oct 2023 19:19:52 +0200 Subject: [PATCH] macOS: Explicitly mark NSView as needing display when unhiding it AppKit doesn't do this automatically for us, and since we may have decided to not draw anything when the view was not exposed, we need to inform clients that its time to draw something now. Pick-to: 6.5 Change-Id: Ib2dd969632898ba5640d6848356acd1b97da652d Reviewed-by: Friedemann Kleint Reviewed-by: Doris Verria (cherry picked from commit ea0b99c0064806397081a6f19a2af56abea726de) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/cocoa/qcocoawindow.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 56322a99639..ff668c17012 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -346,6 +346,10 @@ void QCocoaWindow::setVisible(bool visible) // Make the NSView visible first, before showing the NSWindow (in case of top level windows) m_view.hidden = NO; + // Explicitly mark the view as needing display, as we may + // not have drawn anything to the view when it was hidden. + [m_view setNeedsDisplay:YES]; + if (isContentView()) { QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);