diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index f68a37cbead..141fc61d508 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -949,7 +949,8 @@ - (BOOL) setFrameIfOnScreen:(NSRect)contentRect - (void) setMacDrvParentWindow:(WineWindow*)parent { - if ([self parentWindow] != parent) + WineWindow* oldParent = (WineWindow*)[self parentWindow]; + if ((oldParent && oldParent != parent) || (!oldParent && latentParentWindow != parent)) { [[self parentWindow] removeChildWindow:self]; self.latentParentWindow = nil;