From 5bc02ad6653252ef134f070d7e0083784e705f1e Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 2 Oct 2013 16:19:37 +0200 Subject: [PATCH] Cocoa: Properly unhide views after they're moved to their own window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-32221 Change-Id: I12a475c7a5abdc5ba4d7359d694dd62ea97e67c4 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoawindow.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 54cf8a79fe..7bdfd12314 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -369,9 +369,12 @@ void QCocoaWindow::setVisible(bool visible) [(NSPanel *)m_nsWindow setWorksWhenModal:YES]; } } - } else { - [m_contentView setHidden:NO]; } + // In some cases, e.g. QDockWidget, the content view is hidden before moving to its own + // Cocoa window, and then shown again. Therefore, we test for the view being hidden even + // if it's attached to an NSWindow. + if ([m_contentView isHidden]) + [m_contentView setHidden:NO]; } else { // qDebug() << "close" << this; if (m_nsWindow) {