From 1051abc4800f01c43c3f24cc7d9f85d6a7acc7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 19 May 2017 12:25:38 +0200 Subject: [PATCH] macOS: Remove workaround when setting view as content view abde2a59c60 introduced this code on the basis that setContentView does not remove the view from its superview, but disassembly of AppKit shows that it does. Since commit 52767b8ee754 we also ensure that the previous NSWindow has its contentView property cleared, so this workaround is no longer needed. Task-number: QTBUG-39628 Change-Id: I21e179263d006f3af1f8a55e9e2f7e8eeab2a632 Reviewed-by: Timur Pocheptsov Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index b2a434b550..ca5f3e8992 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1655,11 +1655,7 @@ void QCocoaWindow::recreateWindowIfNeeded() // Move view to new NSWindow if needed if (newWindow) { [m_view setPostsFrameChangedNotifications:NO]; - [m_view retain]; - if (m_view.superview) // m_view comes from another NSWindow - [m_view removeFromSuperview]; [newWindow setContentView:m_view]; - [m_view release]; [m_view setPostsFrameChangedNotifications:YES]; m_nsWindow = newWindow;