diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index bf574ab43..ebf440b6d 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -624,7 +624,7 @@ CPRunContinuesResponse = -1002; var listener = _eventListeners.pop(); listener._callback(anEvent); - if (listener._shouldDequeue) + if (listener._dequeue) return; } } diff --git a/AppKit/CPWindow/_CPWindow.j b/AppKit/CPWindow/_CPWindow.j index 0a3b39725..c3431415d 100644 --- a/AppKit/CPWindow/_CPWindow.j +++ b/AppKit/CPWindow/_CPWindow.j @@ -800,6 +800,14 @@ CPTexturedBackgroundWindowMask [self makeMainWindow]; } +/* + Called when a parent window orders in a child window directly. + without going through the ordering methods in CPWindow. +*/ +- (void)_parentDidOrderInChild +{ +} + /* Makes the receiver the last window in the screen ordering. @param aSender the object that requested this diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index f42465e53..ae91f7f5c 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -1489,10 +1489,11 @@ var resizeTimer = nil; for (var i = 0; i < count; ++i) { - var child = children[i]; + var child = children[i], + childWasVisible = [child isVisible]; // If a child is not visible and has not yet been ordered in, skip it - if (![child isVisible] && ![child _hasBeenOrderedIn]) + if (!childWasVisible && ![child _hasBeenOrderedIn]) continue; var ordering = [child _childOrdering]; @@ -1505,13 +1506,14 @@ var resizeTimer = nil; [aLayer insertWindow:child atIndex:index]; + if (!childWasVisible) + [child _parentDidOrderInChild]; + if ([[child childWindows] count]) [self _orderChildWindowsOf:child furthestParent:furthestParent layer:aLayer]; parent = child; } - - return index; } - (void)_removeLayers diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index e96c97b1d..d1649e257 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -329,8 +329,6 @@ var _CPPopoverWindow_shouldClose_ = 1 << 0, _targetView = positioningView; } - [_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil]; - /* If _targetView's window is not a full platform window, add us as a child, because when we close we are detached from @@ -486,6 +484,19 @@ var _CPPopoverWindow_shouldClose_ = 1 << 0, _isClosing = NO; } +- (void)_orderFront +{ + if (![self isVisible]) + [_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil]; + + [super _orderFront]; +} + +- (void)_parentDidOrderInChild +{ + [_targetView addObserver:self forKeyPath:@"frame" options:0 context:nil]; +} + /*! @ignore Animate window closing.