macOS: Re-apply QWindow visibility when moved between NSWindows

When a QWindow is moved between being a child window and a top level,
it gains a corresponding QNSWindow, which we create as part of
QCocoaWindow::createNSWindow(). NSWindows are not visible by default,
so we need to re-apply the QWindow state to the newly created window,
just like we do for other QWindow properties.

Change-Id: I809d12b09eeccea7a4ee4e8444f69db46dbd159e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit a143158eb12c398c756532aaec58340ec980b44d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-08-16 12:45:22 +02:00 committed by Qt Cherry-pick Bot
parent 44a2dd16ed
commit 281b5154bf

View File

@ -225,6 +225,7 @@ NSWindow<QNSWindowProtocol> *qnswindow_cast(NSWindow *window)
m_platformWindow->setWindowFilePath(window->filePath()); // Also sets window icon
m_platformWindow->setWindowState(window->windowState());
m_platformWindow->setOpacity(window->opacity());
m_platformWindow->setVisible(window->isVisible());
}
- (NSString *)description