Make NSApplication's responder chain for action messages consistent

with Apple's documentation and the Mac OS X implementation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27008 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2008-11-05 22:05:58 +00:00
parent 4e48499493
commit edd9b4a68a

View file

@ -2041,7 +2041,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
*/
- (id) targetForAction: (SEL)aSelector forWindow: (NSWindow *)window
{
id resp;
id resp, delegate;
resp = [window firstResponder];
while (resp != nil && resp != self)
@ -2050,15 +2050,17 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
{
return resp;
}
if (resp == window)
{
delegate = [window delegate];
if ([delegate respondsToSelector: aSelector])
{
return delegate;
}
}
resp = [resp nextResponder];
}
resp = [window delegate];
if (resp != nil && [resp respondsToSelector: aSelector])
{
return resp;
}
if ([NSDocumentController isDocumentBasedApplication])
{
resp = [[NSDocumentController sharedDocumentController]