From ac9497a0efc2a56864012d824aa78035dea1c222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 21 Jul 2020 14:15:05 +0200 Subject: macOS: Remove stale code for handling view hiding during reparenting Commit a2bdda8e3ba added an unconditional hide of child NSViews, which was found to be too strict, and worked around in a199a87ad by undoing the hide during setParent(). The unconditional hide was then changed in 89842b97d7 to use the visibility state of the window, which means the workaround in a199a87ad is no longer needed. Change-Id: If0df2de65693e03c5fb53a906b1399accab3fcc4 Reviewed-by: Volker Hilsheimer --- src/plugins/platforms/cocoa/qcocoawindow.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/cocoa') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index af490d49b5..34e60e938f 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1105,11 +1105,9 @@ void QCocoaWindow::setParent(const QPlatformWindow *parentWindow) { qCDebug(lcQpaWindow) << "QCocoaWindow::setParent" << window() << (parentWindow ? parentWindow->window() : 0); - // recreate the window for compatibility - bool unhideAfterRecreate = parentWindow && !isEmbedded() && ![m_view isHidden]; + // Recreate in case we need to get rid of a NSWindow, or create one recreateWindowIfNeeded(); - if (unhideAfterRecreate) - [m_view setHidden:NO]; + setCocoaGeometry(geometry()); } -- cgit v1.2.3