diff --git a/ChangeLog b/ChangeLog index 6fc2e5b88..57d883af4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-05 Doug Simons + + * Source/NSView.m: Fix the worst problems with key view + chain. There should only be a single next key view, ever, + although possibly multiple previous key views. + 2010-04-05 Doug Simons * Source/NSWindow.m: Fix crash caused by close being called diff --git a/Source/NSView.m b/Source/NSView.m index 2d7c48862..a051de5c8 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3610,13 +3610,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) GSIArrayRemoveItemAtIndex(pKV(tmp), count); } } - /* - * If the view still points to us, make a note of it in the - * 'next' array while making space for the new link to aView. - */ if (GSIArrayItemAtIndex(pKV(tmp), 0).obj == self) { - GSIArrayInsertItem(nKV(self), (GSIArrayItem)nil, 0); + GSIArraySetItemAtIndex(pKV(tmp), (GSIArrayItem)nil, 0); } } @@ -4558,8 +4554,13 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) _autoresizes_subviews = YES; _autoresizingMask = NSViewNotSizable; _coordinates_valid = NO; - _nextKeyView = 0; - _previousKeyView = 0; + /* + * Note: don't zero _nextKeyView and _previousKeyView, as the key view + * chain may already have been established by super's initWithCoder: + * + * _nextKeyView = 0; + * _previousKeyView = 0; + */ _rFlags.flipped_view = [self isFlipped];