From 6b235ab083156c5fdd82689d02199a3f9e75bd7a Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Tue, 10 Feb 2015 22:58:03 -0800 Subject: [PATCH] Fixed: CPPopover position does not update each time Previously, when the frame of a superview of the targetedView would update, the popover did not update its position. Now it does by observing each frame of each superviews of the targetedView. --- AppKit/_CPPopoverWindow.j | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index 27d160e17..e836fea73 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -181,7 +181,14 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4, return; _isObservingFrame = YES; - [_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil]; + + var view = _targetView; + + while (view) + { + [view addObserver:self forKeyPath:@"frame" options:0 context:nil]; + view = [view superview]; + } } /*! @@ -194,7 +201,14 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4, return; _isObservingFrame = NO; - [_targetView removeObserver:self forKeyPath:@"frame"]; + + var view = _targetView; + + while (view) + { + [view removeObserver:self forKeyPath:@"frame"]; + view = [view superview]; + } } /*!