From: Ken Thomases Subject: winemac: Call -removeFromSuperview on a view before adding it to a superview, on 10.9 and earlier. Message-Id: <1469168706-98404-1-git-send-email-ken@codeweavers.com> Date: Fri, 22 Jul 2016 01:25:06 -0500 This works around a Cocoa bug that causes an exception and hang if the view is being re-ordered within its current superview (as opposed to being moved to a new superview). This reverts commit 9fbc364ea103239553701aa9a9932e3fdabcfff6 but adds some conditions around the call to avoid the flicker on platforms where it's unnecessary. Signed-off-by: Ken Thomases --- For . dlls/winemac.drv/cocoa_window.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 808a7e7..c6e0709 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -3357,6 +3357,10 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma WineWindow* oldWindow = (WineWindow*)[view window]; WineWindow* newWindow = (WineWindow*)[superview window]; +#if !defined(MAC_OS_X_VERSION_10_10) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10 + if (floor(NSAppKitVersionNumber) <= 1265 /*NSAppKitVersionNumber10_9*/) + [view removeFromSuperview]; +#endif if (prev) [superview addSubview:view positioned:NSWindowBelow relativeTo:prev]; else -- 2.8.2