From facd97c09df16b75e57091303366483e1a40983d Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Wed, 13 Mar 2013 16:39:14 -0400 Subject: [PATCH] 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. --- AppKit/_CPPopoverWindow.j | 1 + Tests/Manual/AttachedSheet2/SheetWindowController.j | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index b801b880d..32082d1d1 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -543,6 +543,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 0, #endif [_targetView removeObserver:self forKeyPath:@"frame"]; + [_parentWindow removeChildWindow:self]; [super _orderOutRecursively:recursive]; _shouldPerformAnimation = YES; diff --git a/Tests/Manual/AttachedSheet2/SheetWindowController.j b/Tests/Manual/AttachedSheet2/SheetWindowController.j index c53da14e6..e40f49ebb 100644 --- a/Tests/Manual/AttachedSheet2/SheetWindowController.j +++ b/Tests/Manual/AttachedSheet2/SheetWindowController.j @@ -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]; } //