diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index fdc33de6ad7..1977ca089bd 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -712,11 +712,23 @@ - (BOOL) becameEligibleParentOrChild - (void) becameIneligibleParentOrChild { WineWindow* parent = (WineWindow*)[self parentWindow]; + NSArray* childWindows = [self childWindows]; + if (parent) { self.latentParentWindow = parent; [parent removeChildWindow:self]; } + + if ([childWindows count]) + { + WineWindow* child; + for (child in [[childWindows copy] autorelease]) + { + child.latentParentWindow = self; + [self removeChildWindow:child]; + } + } } // Determine if, among Wine windows, this window is directly above or below