summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoawindow.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-10-27 13:43:48 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-11-12 18:40:03 +0200
commit7a7aecae2ac7ae411e5e3a719f82cd1a0e7fe5ee (patch)
tree870e56323ab24cfb16d3f75bb0c428617a0d1fd3 /src/plugins/platforms/cocoa/qcocoawindow.mm
parent0366b554c936e3257797f9c281c1cbd76e426dd3 (diff)
macOS: Clarify relation between occlusion state, hidden state, and expose
Pick-to: 6.5 6.6 Change-Id: I0e05332087fb3f876a9d2fadd9d7dcfd556d5734 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 46f3564257..3fbc06a089 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -371,10 +371,6 @@ 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);
@@ -1326,8 +1322,14 @@ void QCocoaWindow::windowDidOrderOffScreen()
void QCocoaWindow::windowDidChangeOcclusionState()
{
+ // Note, we don't take the view's hiddenOrHasHiddenAncestor state into
+ // account here, but instead leave that up to handleExposeEvent, just
+ // like all the other signals that could potentially change the exposed
+ // state of the window.
bool visible = m_view.window.occlusionState & NSWindowOcclusionStateVisible;
- qCDebug(lcQpaWindow) << "QCocoaWindow::windowDidChangeOcclusionState" << window() << "is now" << (visible ? "visible" : "occluded");
+ qCDebug(lcQpaWindow) << "Occlusion state of" << m_view.window << "for"
+ << window() << "changed to" << (visible ? "visible" : "occluded");
+
if (visible)
[m_view setNeedsDisplay:YES];
else