Ken Thomases : winemac: Call -removeFromSuperview on a view before adding it to a superview, on 10.9 and earlier.

Alexandre Julliard julliard at winehq.org
Fri Jul 22 09:17:57 CDT 2016


Module: wine
Branch: master
Commit: 887db3403e53a422ff6c0817b3aa6466ec3ab604
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=887db3403e53a422ff6c0817b3aa6466ec3ab604

Author: Ken Thomases <ken at codeweavers.com>
Date:   Fri Jul 22 01:25:06 2016 -0500

winemac: Call -removeFromSuperview on a view before adding it to a superview, on 10.9 and earlier.

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 <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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




More information about the wine-cvs mailing list