From 91d0ba8ff438920033050e74ced8b819b2c4b057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 14 Mar 2014 11:33:07 +0100 Subject: [PATCH] Cococa: Make QMacNativeWidget work again. The NSWindow releasing code in recreateWindow() has regressed to not handle the m_contentViewIsToBeEmbedded case. Release the NSWindow directly instead of calling recreateWindow() Change-Id: Ibc6d10faf4c6dae42e02c400b16f28a1d28eb192 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 26fe9f86df..d8ec144ad2 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1113,7 +1113,9 @@ NSWindow *QCocoaWindow::nativeWindow() const void QCocoaWindow::setEmbeddedInForeignView(bool embedded) { m_contentViewIsToBeEmbedded = embedded; - recreateWindow(0); // destroy what was already created + // Release any previosly created NSWindow. + [m_nsWindow closeAndRelease]; + m_nsWindow = 0; } void QCocoaWindow::windowWillMove()