mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 10:11:15 +00:00
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:
parent
144d872afa
commit
fcbb8144be
1 changed files with 9 additions and 7 deletions
|
@ -2041,7 +2041,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
||||||
*/
|
*/
|
||||||
- (id) targetForAction: (SEL)aSelector forWindow: (NSWindow *)window
|
- (id) targetForAction: (SEL)aSelector forWindow: (NSWindow *)window
|
||||||
{
|
{
|
||||||
id resp;
|
id resp, delegate;
|
||||||
|
|
||||||
resp = [window firstResponder];
|
resp = [window firstResponder];
|
||||||
while (resp != nil && resp != self)
|
while (resp != nil && resp != self)
|
||||||
|
@ -2050,15 +2050,17 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
||||||
{
|
{
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
if (resp == window)
|
||||||
|
{
|
||||||
|
delegate = [window delegate];
|
||||||
|
if ([delegate respondsToSelector: aSelector])
|
||||||
|
{
|
||||||
|
return delegate;
|
||||||
|
}
|
||||||
|
}
|
||||||
resp = [resp nextResponder];
|
resp = [resp nextResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
resp = [window delegate];
|
|
||||||
if (resp != nil && [resp respondsToSelector: aSelector])
|
|
||||||
{
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([NSDocumentController isDocumentBasedApplication])
|
if ([NSDocumentController isDocumentBasedApplication])
|
||||||
{
|
{
|
||||||
resp = [[NSDocumentController sharedDocumentController]
|
resp = [[NSDocumentController sharedDocumentController]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue