diff --git a/AppKit/CPView.j b/AppKit/CPView.j index cadcdf356..0b1008501 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -1030,7 +1030,7 @@ var CPViewHighDPIDrawingEnabled = YES; [[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]]; if (!_inhibitUpdateTrackingAreas) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:YES]; } /*! @@ -1103,7 +1103,7 @@ var CPViewHighDPIDrawingEnabled = YES; #endif if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:YES]; } /*! @@ -1257,7 +1257,7 @@ var CPViewHighDPIDrawingEnabled = YES; [[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]]; if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:!_autoresizesSubviews]; } /*! @@ -1306,7 +1306,7 @@ var CPViewHighDPIDrawingEnabled = YES; [[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]]; if (!_inhibitUpdateTrackingAreas) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:YES]; } /*! @@ -1374,7 +1374,7 @@ var CPViewHighDPIDrawingEnabled = YES; [[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]]; if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:YES]; } /*! @@ -1418,7 +1418,7 @@ var CPViewHighDPIDrawingEnabled = YES; [[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]]; if (!_inhibitUpdateTrackingAreas && !_inhibitFrameAndBoundsChangedNotifications) - [self _updateTrackingAreas]; + [self _updateTrackingAreasWithRecursion:YES]; } @@ -3590,21 +3590,21 @@ setBoundsOrigin: [_trackingAreas removeObjectIdenticalTo:trackingArea]; } -- (void)_updateTrackingAreas +- (void)_updateTrackingAreasWithRecursion:(BOOL)shouldCallRecursively { _inhibitUpdateTrackingAreas = YES; - [self _recursivelyUpdateTrackingAreas]; - - _inhibitUpdateTrackingAreas = NO; -} - -- (void)_recursivelyUpdateTrackingAreas -{ [self _updateTrackingAreasForOwners:[self _calcTrackingAreaOwners]]; - for (var i = 0; i < _subviews.length; i++) - [_subviews[i] _recursivelyUpdateTrackingAreas]; + if (shouldCallRecursively) + { + // Now, call _updateTrackingAreasWithRecursion on subviews + + for (var i = 0; i < _subviews.length; i++) + [_subviews[i] _updateTrackingAreasWithRecursion:YES]; + } + + _inhibitUpdateTrackingAreas = NO; } - (CPArray)_calcTrackingAreaOwners diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 380b2b149..fd1a0b469 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -4098,6 +4098,9 @@ var interpolate = function(fromValue, toValue, progress) [overlappingTrackingAreas addObject:aTrackingArea]; } + if (overlappingTrackingAreas.length === 0) + return; + var frontmostTrackingArea = overlappingTrackingAreas[0], frontmostView = [frontmostTrackingArea view];