mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-29 06:57:03 +00:00
Merge pull request #1837 from BlairDuncan/keyViewLoopInfinateLoopFix
Fixed: views from other windows cannot be next/previous key views Previously, a view from another window could be set as the next/previous key view, which would result in unexpected behavior, including an infinite loop. This commit ensures the proposed next/previous view belongs to the same window as the view to which it will be chained.
This commit is contained in:
+2
-2
@@ -2557,7 +2557,7 @@ setBoundsOrigin:
|
||||
|
||||
- (void)_setPreviousKeyView:(CPView)previous
|
||||
{
|
||||
if ([previous isEqual:self])
|
||||
if ([previous isEqual:self] || ![[previous window] isEqual:[self window]])
|
||||
_previousKeyView = nil;
|
||||
else
|
||||
_previousKeyView = previous;
|
||||
@@ -2565,7 +2565,7 @@ setBoundsOrigin:
|
||||
|
||||
- (void)setNextKeyView:(CPView)next
|
||||
{
|
||||
if ([next isEqual:self])
|
||||
if ([next isEqual:self] || ![[next window] isEqual:[self window]])
|
||||
_nextKeyView = nil;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user