Fixed: if orderOut: was not called for a popover, it would not detach from its parent

When a transient popover was closed by clicking, in some cases it would not detach from its parent, leaving it in the window list. This caused problems later on.

This commit ensures the popover is detached from its parent when it is ordered out.
This commit is contained in:
Aparajita Fishman committed 2013-03-13 16:39:14 -04:00
1 parent 3696986a5c
commit facd97c09d
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -543,6 +543,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 0,
#endif
[_targetView removeObserver:self forKeyPath:@"frame"];
[_parentWindow removeChildWindow:self];
[super _orderOutRecursively:recursive];
_shouldPerformAnimation = YES;
@@ -475,8 +475,8 @@
[viewController setView:[[self window] contentView]];
[aPopover setContentSize:[[[self window] contentView] boundsSize]];
[aPopover setAnimates:YES];
[aPopover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:CPMaxXEdge];
[aPopover setBehavior:CPPopoverBehaviorTransient];
[aPopover showRelativeToRect:[sender bounds] ofView:sender preferredEdge:CPMaxXEdge];
}
//