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>bb10
parent
0366b554c9
commit
7a7aecae2a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -273,15 +273,29 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSViewMenuHelper);
|
|||
return focusWindow;
|
||||
}
|
||||
|
||||
/*
|
||||
Invoked when the view is hidden, either directly,
|
||||
or in response to an ancestor being hidden.
|
||||
*/
|
||||
- (void)viewDidHide
|
||||
{
|
||||
qCDebug(lcQpaWindow) << "Did hide" << self;
|
||||
|
||||
if (!m_platformWindow->isExposed())
|
||||
return;
|
||||
|
||||
m_platformWindow->handleExposeEvent(QRegion());
|
||||
}
|
||||
|
||||
// Note: setNeedsDisplay is automatically called for
|
||||
// viewDidUnhide so no reason to override it here.
|
||||
/*
|
||||
Invoked when the view is unhidden, either directly,
|
||||
or in response to an ancestor being unhidden.
|
||||
*/
|
||||
- (void)viewDidUnhide
|
||||
{
|
||||
qCDebug(lcQpaWindow) << "Did unhide" << self;
|
||||
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (BOOL)isTransparentForUserInput
|
||||
|
|
|
|||
Loading…
Reference in New Issue